Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp1562228ybg; Wed, 23 Oct 2019 18:23:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqyDtTjWsy2YwD50vwF34lz0lLNlmorBBxOlXzaLQ2aJMPp4ZDUtlfI0/rW7DXkI5G4/C8sU X-Received: by 2002:aa7:dc44:: with SMTP id g4mr19425478edu.266.1571880236881; Wed, 23 Oct 2019 18:23:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571880236; cv=none; d=google.com; s=arc-20160816; b=PNSnuOhsILFVh0RmLX35Gt4/746Nr7WCdyhx56zGGE4j0x8FfnPX8uI5w+YX/s+jJV KJD1qnWNvxZMDuPxJHhe/aVR0gspuOSwX9NqUlupaVFTlMkInhMbPXrMEec/7XpKf7n9 QjOyGxBr73AhXESrhriR2Zr6d6wrIZpRfs1LvoA8hN7kOPZYhuEuUww1XuZnX43VAKtF 0OukEfsCXfvrYJ97K2u6fHMZFsUeOafaPSRmV/q0LBqtZu8QgUBP3hviaXD57IIp7PQj AC2ZMkaW8TzMEXRyuxWVczjf/PByklTda2YIhxHwQ5wsNtLpcR1NRymQYwZ9VBnDRP48 eHNw== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject :dkim-signature; bh=emR3PoHEO27QDES+p5wODmAC9pYpw/dbeRHOoHO20Ao=; b=vnCbYsqoscFgnswEJggJQ4YNG4DtzEAU6+k40TFSXnawKbrLhVPCBToHP3KB70PxDQ 9EDS5WCTtLktTxDiJpvjsF1niiyQOPUpxR2Rkl0ogewJkb3GP5K074/ccWXiuDUFtZY6 6q/631sdOm4a0QQhhL9TEABsDoQyZUD0P+QgHCxa93Su5q7xVT5hP/9OPH7sivUm0UQ8 brpCfCAmjYbwVWi84VHdAj+Ho1yuSVyt8/QZdqeaP+e/Bhdd12ruWBFREux+BPFyBOR1 eiyeaqs7D/CAhJRD1xGDaYFCJGhUC88VVzgiCB6L3wQS9/v9zetMnUD6r4DMs/GF+Pxs q6YQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="h/41757P"; 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=pass (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 i32si12596777ede.394.2019.10.23.18.23.32; Wed, 23 Oct 2019 18:23:56 -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=@redhat.com header.s=mimecast20190719 header.b="h/41757P"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392307AbfJWOw4 (ORCPT + 99 others); Wed, 23 Oct 2019 10:52:56 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:52050 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2390614AbfJWOw4 (ORCPT ); Wed, 23 Oct 2019 10:52:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571842375; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=emR3PoHEO27QDES+p5wODmAC9pYpw/dbeRHOoHO20Ao=; b=h/41757PEuwfAGRhaSk9UHSlzvoGPYb+V7l6xUsm8v9MhJWZ3bX5AoWWU5daYa/1qEr4Ib VdIc0q29jc6+vBGhQ58X8OSF/sPR7t3Nmqahf6bsA0ItfOegP6FoHOsNFHQJwxMqfeLXkz NSJ1ahdgoOW5gqbCo8MG3HIZAJ6sni0= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-146-60Zyz4gRP82yzeX22HESNA-1; Wed, 23 Oct 2019 10:52:52 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EE120476; Wed, 23 Oct 2019 14:52:49 +0000 (UTC) Received: from llong.remote.csb (dhcp-17-59.bos.redhat.com [10.18.17.59]) by smtp.corp.redhat.com (Postfix) with ESMTP id 193ED5C1D4; Wed, 23 Oct 2019 14:52:45 +0000 (UTC) Subject: Re: [RFC PATCH 1/2] mm, vmstat: hide /proc/pagetypeinfo from normal users To: Michal Hocko , Andrew Morton , Mel Gorman Cc: Johannes Weiner , Roman Gushchin , Vlastimil Babka , Konstantin Khlebnikov , Jann Horn , Song Liu , Greg Kroah-Hartman , Rafael Aquini , linux-mm@kvack.org, LKML , Michal Hocko References: <20191023095607.GE3016@techsingularity.net> <20191023102737.32274-1-mhocko@kernel.org> <20191023102737.32274-2-mhocko@kernel.org> From: Waiman Long Organization: Red Hat Message-ID: <48c4b79b-d2e6-684c-2d0e-7693985817f1@redhat.com> Date: Wed, 23 Oct 2019 10:52:44 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: <20191023102737.32274-2-mhocko@kernel.org> Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-MC-Unique: 60Zyz4gRP82yzeX22HESNA-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/23/19 6:27 AM, Michal Hocko wrote: > From: Michal Hocko > > /proc/pagetypeinfo is a debugging tool to examine internal page > allocator state wrt to fragmentation. It is not very useful for > any other use so normal users really do not need to read this file. > > Waiman Long has noticed that reading this file can have negative side > effects because zone->lock is necessary for gathering data and that > a) interferes with the page allocator and its users and b) can lead to > hard lockups on large machines which have very long free_list. > > Reduce both issues by simply not exporting the file to regular users. > > Reported-by: Waiman Long > Cc: stable > Signed-off-by: Michal Hocko > --- > mm/vmstat.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/mm/vmstat.c b/mm/vmstat.c > index 6afc892a148a..4e885ecd44d1 100644 > --- a/mm/vmstat.c > +++ b/mm/vmstat.c > @@ -1972,7 +1972,7 @@ void __init init_mm_internals(void) > #endif > #ifdef CONFIG_PROC_FS > =09proc_create_seq("buddyinfo", 0444, NULL, &fragmentation_op); > -=09proc_create_seq("pagetypeinfo", 0444, NULL, &pagetypeinfo_op); > +=09proc_create_seq("pagetypeinfo", 0400, NULL, &pagetypeinfo_op); > =09proc_create_seq("vmstat", 0444, NULL, &vmstat_op); > =09proc_create_seq("zoneinfo", 0444, NULL, &zoneinfo_op); > #endif Acked-by: Waiman Long