Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp631443ybg; Wed, 23 Oct 2019 03:32:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqyFC4pGkLuAu9IIBS8acg6rfEMTUNKRzwagzXayblU3wt2waITU2EmBPA3SOBDeweaqGXNW X-Received: by 2002:a17:906:5955:: with SMTP id g21mr7158029ejr.213.1571826736839; Wed, 23 Oct 2019 03:32:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571826736; cv=none; d=google.com; s=arc-20160816; b=Y8fZBooCybmwr2G6jh7t9l3P8wGL5tvXtxabhTE+glZ5Iq5Ky4IXuBtH3RAe2/XnrV ppqIoH2ujlbwwmt09kRTNOUtvhcGWHirUZf43jMovb4sqHrBmbrhA2FqOhP0C0Kf5l4d EVvmj9jsP682CUlhKYUzjkQLq7qYCe7OKMlEq/9TyOlqbWHywCSXPlaAanVYuoFAvqJz okHftjwjjSsi549RG1kWCdy/9SLOfPMowWffAvlwreVLtqbw2P4TcvtZejXOx86N/zCO 0Zlcgx05OHtnYs3NIOlXwB5ZJTbJUgO8Sho2uyaw4I3f3mgz8dZluT8yjSeAmsvlXmea SO9w== 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:date:subject:cc:to:from; bh=TsLzXYwYLSB8hHF4vHJgIrxG5rx+YZo4hwBqQCis9kU=; b=tG0AHRH0p55w3lYPGioK6KBePYXM9Xbl2IFuNfngXXE3gNpYXkyYEh6xGz3kHO6FWh 0SBkm3Q1fSg97MBz1SOEiInd2cct/vRwVRbz8XYoNrGZ5IPG+a4cA0KNBUn5mwvL9FOv e4qpOPdopZT1QGs+5OsLJ7Sc1COU0vf8g4cYbNFeWUMK9zASCXHSmHx5S2+IhWA/HfRB NRDe0u3pA26UxsdPc/Lyqf8tpGVDWiDcR51cajuuA2eI2+ySrV5jkNFU9JyEUNl1RZbQ hMV6g3NW4phH6QrY7we/QnZ5D0itp0uVmX92bENLmSFG8mrTgUJ9eImLZKxnay5xcy6X hTew== 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 i3si1147129ejs.154.2019.10.23.03.31.52; Wed, 23 Oct 2019 03:32:16 -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 S2404408AbfJWK1y (ORCPT + 99 others); Wed, 23 Oct 2019 06:27:54 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:39456 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404089AbfJWK1x (ORCPT ); Wed, 23 Oct 2019 06:27:53 -0400 Received: by mail-wm1-f67.google.com with SMTP id r141so9513731wme.4 for ; Wed, 23 Oct 2019 03:27:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=TsLzXYwYLSB8hHF4vHJgIrxG5rx+YZo4hwBqQCis9kU=; b=HMEcdTrR4CvUBuOE/pxGdcLXELcvaRrzceVSud5clQgbs5E9hVfOR8m8XtaHdO6iaM 0KDid/rHDUfvx2pz5SVf+akkm18nDfrxb7w66mL6iVX3+G5/bGw9J40pd6aFRbHA2wCh g/3xTrthcykr4AbPtZfVRkVatqcMvINLfgxyW+afwmw98exMYHxHIreBJo8knkT46XKl MLYsxJFYDhXgGV54rYH660VzeaCiWyciSCq8oB+WYmRxi1hxwZ248jhmg0KjopxfgVhn xHOkvOV5H8yKz8ISkL2+srjgz8vk7kwhIjiuicuOdikQBtInwiS9TqlLYl3ej+cFSjbu MJBA== X-Gm-Message-State: APjAAAU276a0flBFWwtCs835UNvXW1b95ldVwiVPqx2qz1CdPqhXoWYz jOHzpR6fdcX2TkjxxKeCMPI= X-Received: by 2002:a1c:1d41:: with SMTP id d62mr7091015wmd.32.1571826471365; Wed, 23 Oct 2019 03:27:51 -0700 (PDT) Received: from tiehlicka.suse.cz (ip-37-188-173-3.eurotel.cz. [37.188.173.3]) by smtp.gmail.com with ESMTPSA id u21sm18234122wmu.27.2019.10.23.03.27.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Oct 2019 03:27:50 -0700 (PDT) From: Michal Hocko To: Andrew Morton , Mel Gorman , Waiman Long Cc: Johannes Weiner , Roman Gushchin , Vlastimil Babka , Konstantin Khlebnikov , Jann Horn , Song Liu , Greg Kroah-Hartman , Rafael Aquini , , LKML , Michal Hocko Subject: [RFC PATCH 1/2] mm, vmstat: hide /proc/pagetypeinfo from normal users Date: Wed, 23 Oct 2019 12:27:36 +0200 Message-Id: <20191023102737.32274-2-mhocko@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191023102737.32274-1-mhocko@kernel.org> References: <20191023095607.GE3016@techsingularity.net> <20191023102737.32274-1-mhocko@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 proc_create_seq("buddyinfo", 0444, NULL, &fragmentation_op); - proc_create_seq("pagetypeinfo", 0444, NULL, &pagetypeinfo_op); + proc_create_seq("pagetypeinfo", 0400, NULL, &pagetypeinfo_op); proc_create_seq("vmstat", 0444, NULL, &vmstat_op); proc_create_seq("zoneinfo", 0444, NULL, &zoneinfo_op); #endif -- 2.20.1