Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3929917imu; Mon, 28 Jan 2019 13:32:46 -0800 (PST) X-Google-Smtp-Source: ALg8bN7ebRs3NbxHyJ5I8V5ecRwufI0Dp0s+LSztAt8R89sf/YYFyo+i40XabTPL2W7ceoQwQfky X-Received: by 2002:a17:902:7e0d:: with SMTP id b13mr23698157plm.154.1548711166910; Mon, 28 Jan 2019 13:32:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548711166; cv=none; d=google.com; s=arc-20160816; b=KgBHDWM1St/W27zRhLRo2GCpcgRpWW40BDNwtQ6ah126WuDYZORM0OZXHP+ahPxbtq tBsA2hfT5Iv4At1IIBFiGWY8K4xdpuUUwoN5zMgrWBozMx9A5Yb+C5fX30y6aCHa0et5 oVHKAWkToILt/kqLHqTqG+gGNV3rO1dCT0xiRZncfQr0ubuNs2TFvUEDVaDWPejy3AVp YieiuX0NyyoEXjeTKi93uuztje2syA8/fBfl9+668o2vQ0uBY2w8PIpgDtHG6AedtqG5 6T/+Xd7l0JlOg4iWMYv5vr4J8bfl1dBzj5uqNJj5Lrl5zP2B/s3/PUQsAJnNkGZ+27cl go/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=YAmmgKNRrQc5gbyA9vCwhi1X0/D3dSvcMoWevldO61g=; b=RsVM3giE6emle/Fo8H+Ueg4Sma7Et2daMZQaAz+4PTbUNZz7TvPNcJgSkqBgHwTBju 26MiGN+JAVHmE15UrLtaKoqy9f0XdYpFw448M7+xinlA043BFus3o8CmTkLZ5myMS1pd wx5oXg5xHvsdLfjmMLGdPwqV8dsr8Ub4yc9V0jMc6LLB9JlIfFQdKITkrWD9FUvMvmyY qO5ojL7MMZqESgNqF+kM9N87m9fqxDn2ag0Ctq1mNQiSPAVar+0nMWrNnONshz60qrZZ 6wHwxdtsZxuU36OGhVFo/HPuz6ZpXwINzHSPKNHVQmnEUEDD9PSuIPkfwGbZkf3aw+tJ 1sFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cmpxchg-org.20150623.gappssmtp.com header.s=20150623 header.b=ZEOZkIB1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f2si30030732plt.101.2019.01.28.13.32.30; Mon, 28 Jan 2019 13:32:46 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@cmpxchg-org.20150623.gappssmtp.com header.s=20150623 header.b=ZEOZkIB1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727000AbfA1VbV (ORCPT + 99 others); Mon, 28 Jan 2019 16:31:21 -0500 Received: from mail-yw1-f65.google.com ([209.85.161.65]:35273 "EHLO mail-yw1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726744AbfA1VbV (ORCPT ); Mon, 28 Jan 2019 16:31:21 -0500 Received: by mail-yw1-f65.google.com with SMTP id h32so7374211ywk.2 for ; Mon, 28 Jan 2019 13:31:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=YAmmgKNRrQc5gbyA9vCwhi1X0/D3dSvcMoWevldO61g=; b=ZEOZkIB1dewlaD5Y88LebQn5HMgZEDeuALlgAC8pDnS/sfQZ8K6q8lkY836iFp/Kdw 1It/VXY71UBzl1Bq7uh1IQfoJmSOqpgULvqmJE3ZspNPl8BPV5sjb83Xb/fC2Mzd/yhA Eu6LIMbmYraCkmEsuq7xjdLo/MM+VJPVxA/A9rZgYLOlqGTs+CVaHhBvXqOFUBWs2gES +xKhaDOu2ZiqRD85iIYTWm8h0IpSudZoXEA+qxmeXddUu0fljZFnNNJvAJjk2cFervnN dFRepVyf/R1qL4CFhy5JHnciEQw4kJrZvH+kb5VjmytlAglZ+q8KE0yqeQQh/uZ4s8Tv og1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=YAmmgKNRrQc5gbyA9vCwhi1X0/D3dSvcMoWevldO61g=; b=JPeQzUCzVqyMg6hh2LFF2iBdC8zWZn1uPFzs2Ujp+aNfoEP3byRpnHmG/pJHhHt7DM a2zW+HUNoQWFUDQwpZ8Hat1D9hDmdmrK++iu3FPTGdnp5n1vfNq8D13tZZp8dbJmlVUB /C37Olx3D6f+LoaDaaXsIof3iUWB4GdkXAyP0QIeylc3c8YM4KKLr+67AoGNiHzGhSkQ ThoH1a/ce030phAWGTPmB7JG//7pEWIO4EULB2bu0ExsDjk5BhVkfJvZorYFoyTe7q8Q yGltaL4uVLab4hejKrKp5ILVQORFQvkvohSsnksYdZ1GzJ/OZccVPbn/UptuBykN/8vC oj2Q== X-Gm-Message-State: AJcUukeFbwOD/D1GPI8pekxlmjqIM8Fx6foyejnEdxmWaoR1wzFOlBb/ DM2+mY71JVndLUllW7g8PK8OBw== X-Received: by 2002:a81:11d5:: with SMTP id 204mr22836937ywr.287.1548711079931; Mon, 28 Jan 2019 13:31:19 -0800 (PST) Received: from localhost ([2620:10d:c091:200::5:42c8]) by smtp.gmail.com with ESMTPSA id p3sm12266647ywc.14.2019.01.28.13.31.18 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 28 Jan 2019 13:31:19 -0800 (PST) Date: Mon, 28 Jan 2019 16:31:18 -0500 From: Johannes Weiner To: Rik van Riel Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, kernel-team@fb.com, Chris Mason , Roman Gushchin , Andrew Morton , Michal Hocko Subject: Re: [PATCH] mm,slab,vmscan: accumulate gradual pressure on small slabs Message-ID: <20190128213118.GE1416@cmpxchg.org> References: <20190128143535.7767c397@imladris.surriel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190128143535.7767c397@imladris.surriel.com> User-Agent: Mutt/1.11.2 (2019-01-07) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 28, 2019 at 02:35:35PM -0500, Rik van Riel wrote: > There are a few issues with the way the number of slab objects to > scan is calculated in do_shrink_slab. First, for zero-seek slabs, > we could leave the last object around forever. That could result > in pinning a dying cgroup into memory, instead of reclaiming it. > The fix for that is trivial. > > Secondly, small slabs receive much more pressure, relative to their > size, than larger slabs, due to "rounding up" the minimum number of > scanned objects to batch_size. > > We can keep the pressure on all slabs equal relative to their size > by accumulating the scan pressure on small slabs over time, resulting > in sometimes scanning an object, instead of always scanning several. > > This results in lower system CPU use, and a lower major fault rate, > as actively used entries from smaller caches get reclaimed less > aggressively, and need to be reloaded/recreated less often. > > Fixes: 4b85afbdacd2 ("mm: zero-seek shrinkers") > Fixes: 172b06c32b94 ("mm: slowly shrink slabs with a relatively small number of objects") > Cc: Johannes Weiner > Cc: Chris Mason > Cc: Roman Gushchin > Cc: kernel-team@fb.com > Tested-by: Chris Mason Acked-by: Johannes Weiner