Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp2386418ybi; Thu, 18 Jul 2019 07:37:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqyrx2MMLQKk+hgsenDkL49qwg/BVTrnunVyrlkaTX3KVhhG8leNQqBokfwPXSvcgLeSZCqO X-Received: by 2002:a17:902:3103:: with SMTP id w3mr51439198plb.84.1563460666283; Thu, 18 Jul 2019 07:37:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563460666; cv=none; d=google.com; s=arc-20160816; b=ltbXSQ6L9LI/uoN71/LkbKRwRcboiEBw6zu5ib/7iuscglEbvyp8SRlovmOwAJuVMT q7sq1B008vWtPvtr6Dd+/9rcOEBb2osxCHw1R3EIQfrWKS/JqPBxncbJweySiaKQFBjl BA8QwpD6srDsI8T6meyIyHCnX63JXNsp5MkRPOiZGjeph1Nf81NIwZpQ9oUnjYGFnHbG mhLbuFLaDU/Zt4djVXr5Ao8mn4j//tE/JM00hWG5TITLgwOjpbIK7zTZEcO5VEn+CZo4 uztukAR/MjuHszGbCcT0VkeZXHI8AGu3/7UxVuOOAJVzRo9FWG09kFctJU0TEcq93agC uT6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject; bh=KwTBvK6zXDUSlUosZQWtOpNlgy8yUy48FWLBaO4pbh8=; b=p3sM1D8T3bXBK4yDnR1ik0RlbYxqLmZj9L8lTJ/llBQASZEOA4qbxk8FkMuTEr4RgM qFCrNcvKRYJablFZCb32RaheSj58b1G5Rn66mQkgacj7gA54M4RuEgs3xSZJQ533uRv5 6TgF4McSqJ9I4sAmaWUQ1zkhtepnbKvk1R44LKwAqaWprI039nh1yTbI4mCnePHNIU5F dUESCYBU488eaCFmErHRw77NG+Jq5Gu0tNslmZ8IqbjAU76JTdbutlkdy51aUqPNWdUM 5OGELzX72KKlQzFcwvRvECaUqpV9fXAD3ozPmiSghi2EwTSpqA8yh7hqFhII4LgLKHaW UdJw== ARC-Authentication-Results: i=1; mx.google.com; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k11si3036491pfi.3.2019.07.18.07.37.29; Thu, 18 Jul 2019 07:37:46 -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; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727812AbfGROhE (ORCPT + 99 others); Thu, 18 Jul 2019 10:37:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50288 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726040AbfGROhE (ORCPT ); Thu, 18 Jul 2019 10:37:04 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8C258C09AD0F; Thu, 18 Jul 2019 14:37:02 +0000 (UTC) Received: from llong.remote.csb (dhcp-17-160.bos.redhat.com [10.18.17.160]) by smtp.corp.redhat.com (Postfix) with ESMTP id 14D3660576; Thu, 18 Jul 2019 14:36:59 +0000 (UTC) Subject: Re: [PATCH v2 2/2] mm, slab: Show last shrink time in us when slab/shrink is read To: Christopher Lameter Cc: Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Michal Hocko , Roman Gushchin , Johannes Weiner , Shakeel Butt , Vladimir Davydov References: <20190717202413.13237-1-longman@redhat.com> <20190717202413.13237-3-longman@redhat.com> <0100016c04e1562a-e516c595-1d46-40df-ab29-da1709277e9a-000000@email.amazonses.com> From: Waiman Long Organization: Red Hat Message-ID: <6fb9f679-02d1-c33f-2d79-4c2eaa45d264@redhat.com> Date: Thu, 18 Jul 2019 10:36:59 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <0100016c04e1562a-e516c595-1d46-40df-ab29-da1709277e9a-000000@email.amazonses.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Thu, 18 Jul 2019 14:37:03 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/18/19 7:39 AM, Christopher Lameter wrote: > On Wed, 17 Jul 2019, Waiman Long wrote: > >> The show method of /sys/kernel/slab//shrink sysfs file currently >> returns nothing. This is now modified to show the time of the last >> cache shrink operation in us. > What is this useful for? Any use cases? I got query about how much time will the slab_mutex be held when shrinking the cache. I don't have a solid answer as it depends on how many memcg caches are there. This patch is a partial answer to that as it give a rough upper bound of the lock hold time. >> CONFIG_SLUB_DEBUG depends on CONFIG_SYSFS. So the new shrink_us field >> is always available to the shrink methods. > Aside from minimal systems without CONFIG_SYSFS... Does this build without > CONFIG_SYSFS? The sysfs code in mm/slub.c is guarded by CONFIG_SLUB_DEBUG which, in turn, depends on CONFIG_SYSFS. So if CONFIG_SYSFS is off, the shrink sysfs methods will be off as well. I haven't tried doing a minimal build. I will certainly try that, but I don't expect any problem here. Cheers, Longman