Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp1533001ybg; Wed, 23 Oct 2019 17:48:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqwRAuN9VqBvya/S8dd6r+HNhQVnbRg9bUcwKwtBRc3nY9moOO5HhSFTXFiU8qNBGRSp/GEa X-Received: by 2002:a17:907:429c:: with SMTP id ny20mr34546328ejb.234.1571878129168; Wed, 23 Oct 2019 17:48:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571878129; cv=none; d=google.com; s=arc-20160816; b=ovb9rd98qw6cj/H9Aw0lFjrhweVez7JYiaM6054BjvzyKt9dAVxaDvctRK7y/Nh1qT nSaD5spbWqk6ZqmhaPXw0pqyndSA5kcT96nZv9t/LkRiLmi6tCpQomHEpX2Xnw0vMJp2 fgLUt3KUqanNxP9hh1DHUCQ9FH6EExyXziW9X8UJYCuxSSfO6z1plM+T8qk+vWYOh+cw VVUvWpd7wzitTEAsGWD1dWjek+PyxAq2dNjlSafR0VOl8jipGygclQT2Hd9Yw71aWDi3 GwUVfvvsgYC9nZIYZukblxKF/sRHk9pWAPCjbFS+avwde+kOiCna5MpoIAdmlzRVeD43 QWpA== 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; bh=W/3/KFgi26GA9hukrJIPg6PfM6G8cbLNd+oYQH8NgEo=; b=ECrCCiv+VJtDaa9IIt2J4Z3cDazyhB7zOtyaj5xTnmWHUtt63ICdYOJjUhMiSLaQhU 457pB3W8ZvdPCKWASOB1NA+YCAdO3UOenYkLD7mGy1Fbb1K0herD0I1GS0u6mxjKf0pY xsv8E5pu0CrcMAXQQ3tCvL47fI400TIrxHpw6j4q668t+g+dOAHn0094eAhoGVV8ISNt jGmcr8jfnl6p+M1Mam3ilg9pUYk3xvxHejg24bpyIAgCoAKh14Ps0ttlPQvOWNwcnPWS T85Wrk/FcihFaZbyfPZwQ6igl3I1JkYutvDRNg8XW2p38t/Xp48j1zr2a77Bv8Pnfwv4 W31w== 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m33si15942298edc.94.2019.10.23.17.48.24; Wed, 23 Oct 2019 17:48:49 -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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2406368AbfJWObG (ORCPT + 99 others); Wed, 23 Oct 2019 10:31:06 -0400 Received: from mx2.suse.de ([195.135.220.15]:43858 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2403845AbfJWObF (ORCPT ); Wed, 23 Oct 2019 10:31:05 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id A5D9AB442; Wed, 23 Oct 2019 14:31:03 +0000 (UTC) Date: Wed, 23 Oct 2019 16:31:02 +0200 From: Michal Hocko To: Vlastimil Babka Cc: Andrew Morton , Mel Gorman , Waiman Long , Johannes Weiner , Roman Gushchin , Konstantin Khlebnikov , Jann Horn , Song Liu , Greg Kroah-Hartman , Rafael Aquini , linux-mm@kvack.org, LKML Subject: Re: [RFC PATCH 2/2] mm, vmstat: reduce zone->lock holding time by /proc/pagetypeinfo Message-ID: <20191023143102.GI17610@dhcp22.suse.cz> References: <20191023095607.GE3016@techsingularity.net> <20191023102737.32274-1-mhocko@kernel.org> <20191023102737.32274-3-mhocko@kernel.org> <30211965-8ad0-416d-0fe1-113270bd1ea8@suse.cz> <20191023133720.GA17610@dhcp22.suse.cz> <7fb34979-66a4-4a5d-1798-402826e31e72@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7fb34979-66a4-4a5d-1798-402826e31e72@suse.cz> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 23-10-19 15:48:36, Vlastimil Babka wrote: > On 10/23/19 3:37 PM, Michal Hocko wrote: > > On Wed 23-10-19 15:32:05, Vlastimil Babka wrote: > >> On 10/23/19 12:27 PM, Michal Hocko wrote: > >>> From: Michal Hocko > >>> > >>> pagetypeinfo_showfree_print is called by zone->lock held in irq mode. > >>> This is not really nice because it blocks both any interrupts on that > >>> cpu and the page allocator. On large machines this might even trigger > >>> the hard lockup detector. > >>> > >>> Considering the pagetypeinfo is a debugging tool we do not really need > >>> exact numbers here. The primary reason to look at the outuput is to see > >>> how pageblocks are spread among different migratetypes therefore putting > >>> a bound on the number of pages on the free_list sounds like a reasonable > >>> tradeoff. > >>> > >>> The new output will simply tell > >>> [...] > >>> Node 6, zone Normal, type Movable >100000 >100000 >100000 >100000 41019 31560 23996 10054 3229 983 648 > >>> > >>> instead of > >>> Node 6, zone Normal, type Movable 399568 294127 221558 102119 41019 31560 23996 10054 3229 983 648 > >>> > >>> The limit has been chosen arbitrary and it is a subject of a future > >>> change should there be a need for that. > >>> > >>> Suggested-by: Andrew Morton > >>> Signed-off-by: Michal Hocko > >> > >> Hmm dunno, I would rather e.g. hide the file behind some config or boot > >> option than do this. Or move it to /sys/kernel/debug ? > > > > But those wouldn't really help to prevent from the lockup, right? > > No, but it would perhaps help ensure that only people who know what they > are doing (or been told so by a developer e.g. on linux-mm) will try to > collect the data, and not some automatic monitoring tools taking > periodic snapshots of stuff in /proc that looks interesting. Well, we do trust root doesn't do harm, right? > > Besides that who would enable that config and how much of a difference > > would root only vs. debugfs make? > > I would hope those tools don't scrap debugfs as much as /proc, but I > might be wrong of course :) > > > Is the incomplete value a real problem? > > Hmm perhaps not. If the overflow happens only for one migratetype, one > can use also /proc/buddyinfo to get to the exact count, as was proposed > in this thread for Movable migratetype. Let's say this won't be the case. What is the worst case that the imprecision would cause? In other words. Does it really matter whether we have 100k pages on the free list of the specific migrate type for order or say 200k? -- Michal Hocko SUSE Labs