From owner-freebsd-stable@FreeBSD.ORG Fri Feb 21 13:02:24 2014 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 10AF7AF8; Fri, 21 Feb 2014 13:02:24 +0000 (UTC) Received: from mail-lb0-x234.google.com (mail-lb0-x234.google.com [IPv6:2a00:1450:4010:c04::234]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3228E1A35; Fri, 21 Feb 2014 13:02:23 +0000 (UTC) Received: by mail-lb0-f180.google.com with SMTP id 10so136697lbg.11 for ; Fri, 21 Feb 2014 05:02:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=naXhwdIRvpClT3KwIeVa9hg+nKx8aDPQSuzXMXrIQDs=; b=jbSTekgu6AcAnwG5VTYM9LyTHkUbAyv6yZB3D/5qRVvMTTd6SR7VyFfh2aR/lYC8FJ R41TKyiehAGx6JpK5VLulcJ85PfKRPSClfcd2UH5RQBfOSQKIXJn+kocvKTXyD7toDeh iAPYzOvVMbtCEYfwiRh0UeNP311Z7YFs0HqRHuLl1iO+Q9nIQ2j8oSgkdXEr/Eq+n34N szF29MYrQ6OPu+3xz8gaIECIaBUB8vFtckSdO53REBzC2vRqmw5SkXnderzdthxeUujy a6Y4ih8AFBOMEXAhV2TyUZlrmojOQLQ53bzHcCx9gLVnJznKorllZJt/7cY3I7r0BAEO nlIg== X-Received: by 10.152.207.37 with SMTP id lt5mr4230932lac.90.1392987740685; Fri, 21 Feb 2014 05:02:20 -0800 (PST) Received: from ?IPv6:2a02:6b8::408:b198:a6a3:591e:67a3? ([2a02:6b8:0:408:b198:a6a3:591e:67a3]) by mx.google.com with ESMTPSA id w2sm10632293lad.4.2014.02.21.05.02.18 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 21 Feb 2014 05:02:18 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 7.1 \(1827\)) Subject: Re: Processes are incorrectly marked as swapped out From: Dmitry Sivachenko In-Reply-To: <201401281142.10317.jhb@freebsd.org> Date: Fri, 21 Feb 2014 17:02:16 +0400 Content-Transfer-Encoding: quoted-printable Message-Id: References: <2D47B79E-C171-4B91-B0AB-4DD2212770C6@gmail.com> <201401281142.10317.jhb@freebsd.org> To: John Baldwin X-Mailer: Apple Mail (2.1827) Cc: jeff@freebsd.org, freebsd-stable@freebsd.org, Ronald Klop X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Feb 2014 13:02:24 -0000 On 28 =D1=8F=D0=BD=D0=B2. 2014 =D0=B3., at 20:42, John Baldwin = wrote: > On Thursday, January 23, 2014 8:02:29 am Ronald Klop wrote: >> On Thu, 23 Jan 2014 13:19:36 +0100, Dmitry Sivachenko =20 >> wrote: >>=20 >>> Hello! >>>=20 >>> After upgrade from stable/9 to stable/10 I see the following = regression. >>> Some processes are marked as swapped out in top(1) output: >>>=20 >>> 1436 root 1 43 0 16524K 0K nanslp 14 1:14 = 0.00% =20 >>> >>> 1381 smmsp 1 20 0 23988K 0K pause 18 0:04 = 0.00% =20 >>> >> 99348 mitya 1 21 0 23492K 0K pause 16 0:00 = 0.00% =20 >>> >>>=20 >>> ps(1) also shows them as swapped out (W as second character in state = =20 >>> field): >>> 1381 - IWs 0:00.00 sendmail: Queue runner at 00:30:00 for =20= >>> /var/spool/clie >>> 1436 - IWs 0:00.00 /usr/sbin/cron -s >>> 80231 - IWs 0:00.00 /usr/local/sbin/collectdmon -c =20 >>> /usr/local/sbin/coll >>> 99348 1 IWs 0:00.00 -csh (csh) >>>=20 >>> Though swapinfo reports that zero swap is used and even if I turn = swap =20 >>> completely off (swapoff -a) >>> the output of both top(1) and ps(1) does not change: these processes = are =20 >>> still marked as swapped out. >>=20 >> The code of an application can get removed from memory, because there = =20 >> still is an image of it in the executable on disk. It can be = 'swapped' in =20 >> by reading the executable again. The program is memory mapped (mmap). >> See VN PAGER vs SWAP PAGER in 'systat -vm'. >=20 > However, a swapped out process always uses swap (for kernel stacks), = so this=20 > seems like a real bug. >=20 Okay, I found a buggy commit: Author: jeff Date: Tue Aug 13 21:56:16 2013 New Revision: 254304 URL: http://svnweb.freebsd.org/changeset/base/254304 Log: Improve pageout flow control to wakeup more frequently and do less work = while maintaining better LRU of active pages. <...> Reviewed by: alc (slight variant of this) Discussed with: alc, kib, jhb How do I reproduce the problem: I have a desktop with 2GB of RAM and 4GB = of swap space configured. After "make -j 4 buildworld" I see some processes are swapped out = (sometimes swapinfo reports swap is not used, sometimes it is used but = after swapoff -a those processes are still in swapped out state). I hope this will help to narrow down the problem. Thanks.=