Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp142396ybi; Tue, 2 Jul 2019 17:53:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqxI/eX105FvKvkfHmDQDlo+1jcl1xmikTQb8+w3f1jQ8tGpir9DYioGBiVy1KGi0OoUSnMH X-Received: by 2002:a65:5a44:: with SMTP id z4mr20203766pgs.41.1562115230809; Tue, 02 Jul 2019 17:53:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562115230; cv=none; d=google.com; s=arc-20160816; b=0r3x1T8EwLRavPQ7qr7oGRtiuULZJ7PtsyKm5n3H2K2pNnQf9qHavV96bcIXgSvvVr cjKAiWUgPWzCg/Y/9XoyYt0puGqSdxQnvjAl68P7r/bqIu0uysCem6CMeBRBzR+/dDtD vHwjI8PGUq7QFhCfh2l1AX+4Da3m3Iw110fM2/555tUOGezF/J0pSJ83kjBBubNSXyMI 8A28C0OiAI1+Fh925BCWfYzTOG6odhsAh/4F4+jQSeYustuRwD+AK3uehRzPLUu4BwXv 8fAq0KCySEU0Lr2/IehtJ6/K6Hb0JETMbEahZYlZboQtmHelHPlfBRkva/946p6pdE73 EEfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=Kcly/tuUbH1oIMLuOpvBwc3nXKhDlCKcUqNazXXJwlI=; b=aRPfEM+2AuNuLcC7ddfjtAG0gDmHxz8QvGa6hUFVyEi8tz+JECf1DPXSeghdMwQm3B cItgv6ulEpggzZWz1pATFA9ey7yoAaEVd1fIGPv/ddOGVkekX+ZnMqDJB79u+rbu21Xe dYBZYAswq/ez+woiE5Do2g4PCwkdpstHDU9O0EJDUaK1oXxj8NAFE16za4LaUG48tbeh hDtDPRBMec1Tir9vT7lg2APHy486mBqkCnZveGVToSHogqKnF6H3ZRE32se0zIJHMyRz 9kXqiz4hj/PH9X6rjnAaIkNEMXVLEf/swiniV+bxnV0JrnQx5ylV1Vl3gsCJpaWA884W zf+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Tiln9LxM; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 18si360967pgf.457.2019.07.02.17.53.34; Tue, 02 Jul 2019 17:53:50 -0700 (PDT) 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=@kernel.org header.s=default header.b=Tiln9LxM; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727241AbfGCAxG (ORCPT + 99 others); Tue, 2 Jul 2019 20:53:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:47378 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727101AbfGCAxF (ORCPT ); Tue, 2 Jul 2019 20:53:05 -0400 Received: from akpm3.svl.corp.google.com (unknown [104.133.8.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 662352184C; Tue, 2 Jul 2019 20:03:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1562097799; bh=kyfxYTDfXVVYVh+jLp8SPqoH6e+/on1CISn5rmKjOZ0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Tiln9LxMX1fNAo2/Ddp+J6EQL7IwtJ9uvLaA5tNsAMv7HWx786TfZZ+Zg2iwEa3zy 7DBc6NmB8eX7vXDjNIm9YVca7qmERe9+BWTzyahQE+3k8jNzrBotulWcBmvPHIX2uk qZiUwdYXD/LKMhpngm7ibkztyOQiF7ErCvRr6OuA= Date: Tue, 2 Jul 2019 13:03:18 -0700 From: Andrew Morton To: Waiman Long Cc: Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Alexander Viro , Jonathan Corbet , Luis Chamberlain , Kees Cook , Johannes Weiner , Michal Hocko , Vladimir Davydov , linux-mm@kvack.org, linux-doc@vger.kernel.org, linux-fsdevel@vger.kernel.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, Roman Gushchin , Shakeel Butt , Andrea Arcangeli Subject: Re: [PATCH] mm, slab: Extend slab/shrink to shrink all the memcg caches Message-Id: <20190702130318.39d187dc27dbdd9267788165@linux-foundation.org> In-Reply-To: <20190702183730.14461-1-longman@redhat.com> References: <20190702183730.14461-1-longman@redhat.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2 Jul 2019 14:37:30 -0400 Waiman Long wrote: > Currently, a value of '1" is written to /sys/kernel/slab//shrink > file to shrink the slab by flushing all the per-cpu slabs and free > slabs in partial lists. This applies only to the root caches, though. > > Extends this capability by shrinking all the child memcg caches and > the root cache when a value of '2' is written to the shrink sysfs file. Why? Please fully describe the value of the proposed feature to or users. Always. > > ... > > --- a/Documentation/ABI/testing/sysfs-kernel-slab > +++ b/Documentation/ABI/testing/sysfs-kernel-slab > @@ -429,10 +429,12 @@ KernelVersion: 2.6.22 > Contact: Pekka Enberg , > Christoph Lameter > Description: > - The shrink file is written when memory should be reclaimed from > - a cache. Empty partial slabs are freed and the partial list is > - sorted so the slabs with the fewest available objects are used > - first. > + A value of '1' is written to the shrink file when memory should > + be reclaimed from a cache. Empty partial slabs are freed and > + the partial list is sorted so the slabs with the fewest > + available objects are used first. When a value of '2' is > + written, all the corresponding child memory cgroup caches > + should be shrunk as well. All other values are invalid. One would expect this to be a bitfield, like /proc/sys/vm/drop_caches. So writing 3 does both forms of shrinking. Yes, it happens to be the case that 2 is a superset of 1, but what about if we add "4"?