From owner-freebsd-current@freebsd.org Mon Jan 2 18:27:58 2017 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E3EA9C9C4D6 for ; Mon, 2 Jan 2017 18:27:58 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-wj0-x22a.google.com (mail-wj0-x22a.google.com [IPv6:2a00:1450:400c:c01::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 78A781E64; Mon, 2 Jan 2017 18:27:58 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-wj0-x22a.google.com with SMTP id v7so429887170wjy.2; Mon, 02 Jan 2017 10:27:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=JqHdD+lfEJdssWID5CnN8Z8mQVvFEWW3c9s3MTk/NxY=; b=AwX07tFt0+OSChMlK8/WMp0YSjIAoXfnjA3V0M6wK8V3sWGBfz0clFofPBugOhC2bf rdgaPXCI51s2+YCtu4C16l5LuLs0QC+VIegHJl1S/Z6atj31ATDMrjRYSJsFXjTl+N6n +YOQbPvj2Tlqj+U39iAC3azpckSytFYUCRGQ+W23xSeOuS1BLCixvi9d/pXhnRfxKahN sQGzzNV1EJTgQH6z3UMKbQR8tRn+OCxXDOEKatlVJCP/PoXzKqCarCInBZNzRVckI7hn DYo5l9z1h5B963oTtJ+ChidsMaWla/iTPT56a6/4elruBQQxc+4CLvms3Mh6W6/5fYOE 0lDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=JqHdD+lfEJdssWID5CnN8Z8mQVvFEWW3c9s3MTk/NxY=; b=Ih5wBeLGrUb8WYLFqI0ey6EjeC7s2nvcVfagYHZX6NAjOI+h2z/Asm7FxiXUbru+SA 4DxlqNN9noRkOvJ108PRTQksMFjHBCQPFyEuRoteRDzCtyOO7i6HNX/IEBacQJ/lFlCK aJfXPuNDTiDVj6DraAc2kQIghMEd0hR+yGbyvzKJ0NEbo+H6WQRc84v6EdZP3wYhgvyK EhvvYHylEh/LoYf2OmIoHS3J1occQkVah5pgEz10RuYJVB1zm34ASOeLLT72mlmh2Ugr U/gf23keRyRaF3TA+bZXWY16c2M4eK4Vg2OEcmKng/zICa4awsuGUEUO9cR/EZMBKZCi Imvg== X-Gm-Message-State: AIkVDXJFZ89BWZNVwk/Sj0z6PpanMLNPIV59J6I5jLL9RavPVbE4nRlfbIoqPwr0QmaPrA== X-Received: by 10.194.37.6 with SMTP id u6mr58357972wjj.20.1483381676454; Mon, 02 Jan 2017 10:27:56 -0800 (PST) Received: from wkstn-mjohnston.west.isilon.com (c-76-104-201-218.hsd1.wa.comcast.net. [76.104.201.218]) by smtp.gmail.com with ESMTPSA id u18sm85720870wmd.1.2017.01.02.10.27.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Jan 2017 10:27:55 -0800 (PST) Sender: Mark Johnston Date: Mon, 2 Jan 2017 10:33:52 -0800 From: Mark Johnston To: Jonathan Anderson Cc: alc@freebsd.org, freebsd-current Current Subject: Re: PQ_LAUNDRY: unexpected behaviour Message-ID: <20170102183352.GA46812@wkstn-mjohnston.west.isilon.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.7.2 (2016-11-26) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jan 2017 18:27:59 -0000 On Mon, Jan 02, 2017 at 10:31:50AM -0330, Jonathan Anderson wrote: > Hi all, > > I'm seeing some unexpected PQ_LAUNDRY behaviour on something fairly close > to -CURRENT (drm-next-4.7 with an IFC on 26 Dec). Aside from the use of > not-quite-CURRENT, it's also very possible that I don't understand how the > laundry queue is supposed to work. Nonetheless, I thought I'd check whether > there is a tunable I should change, an issue with the laundry queue itself, > etc. My suspicion is that this is a memory leak of some sort and unrelated to PQ_LAUNDRY itself. That is, with the previous policy you would see lots of swap usage and a large inactive queue instead. > > After running X overnight (i915 can now run overnight on drm-next-4.7!), I > end up with a little over half of my system memory in the laundry queue and > a bunch of swap utilization. Even after closing X and shutting down lots of > services, I see the following in top: > > ``` > Mem: 977M Active, 31M Inact, 4722M Laundry, 1917M Wired, 165M Free > ARC: 697M Total, 67M MFU, 278M MRU, 27K Anon, 22M Header, 331M Other > Swap: 4096M Total, 2037M Used, 2059M Free, 49% Inuse > > PID USERNAME THR PRI NICE SIZE RES STATE C TIME WCPU > COMMAND > 911 root 1 52 0 57788K 4308K select 1 0:00 0.00% sshd > 974 root 1 20 0 43780K 0K wait 2 0:00 0.00% > > 1406 jon 1 20 0 33520K 2748K select 0 0:04 0.00% > gpg-agent > 2038 jon 1 20 0 31280K 5452K ttyin 3 0:18 0.00% zsh > 1251 jon 1 22 0 31280K 4500K pause 3 0:02 1.46% zsh > 7102 jon 1 20 0 31280K 3744K ttyin 0 0:00 0.00% zsh > 1898 jon 1 20 0 31280K 3036K ttyin 1 0:00 0.00% zsh > 1627 jon 1 21 0 31280K 0K pause 0 0:00 0.00% > 22989 jon 1 20 0 31152K 6020K ttyin 1 0:01 0.00% zsh > 22495 jon 1 49 0 31152K 6016K ttyin 0 0:02 0.00% zsh > 1621 jon 1 20 0 28196K 8816K select 2 0:40 0.00% tmux > 6214 jon 1 52 0 27008K 2872K ttyin 1 0:00 0.00% zsh > 6969 jon 1 52 0 27008K 2872K ttyin 3 0:00 0.00% zsh > 6609 root 1 20 0 20688K 4604K select 1 0:00 0.00% > wpa_supplicant > 914 root 1 20 0 20664K 5232K select 2 0:02 0.00% > sendmail > 917 smmsp 1 20 0 20664K 0K pause 0 0:00 0.00% > > 24206 jon 1 23 0 20168K 3500K CPU0 0 0:00 0.00% top > 921 root 1 20 0 12616K 608K nanslp 1 0:00 0.00% cron > ``` > > Are there any things I could do (e.g., sysctls, tunables) to figure out > what's happening? Can I manually force the laundry to be done? `swapoff -a` > fails due to a lack of memory. Is that the full list of processes? Does "ipcs -m" show any named shm segments? Looking at the DRM code, the GEM uses swap objects to back allocations by the drivers, so this could be the result of a kernel page leak in the drm-next branch. If so, you'll need a reboot to recover.