From patchwork Fri Oct 25 07:26:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Hocko X-Patchwork-Id: 11211531 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BABA713B1 for ; Fri, 25 Oct 2019 07:26:29 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8772021D71 for ; Fri, 25 Oct 2019 07:26:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8772021D71 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id AEF896B0003; Fri, 25 Oct 2019 03:26:28 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id AA0196B0006; Fri, 25 Oct 2019 03:26:28 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 98E6D6B0007; Fri, 25 Oct 2019 03:26:28 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0001.hostedemail.com [216.40.44.1]) by kanga.kvack.org (Postfix) with ESMTP id 716356B0003 for ; Fri, 25 Oct 2019 03:26:28 -0400 (EDT) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with SMTP id D2371181AEF31 for ; Fri, 25 Oct 2019 07:26:27 +0000 (UTC) X-FDA: 76081474014.27.corn07_3864b4b0be91b X-Spam-Summary: 2,0,0,21d865e0c35a2840,d41d8cd98f00b204,mstsxfx@gmail.com,:akpm@linux-foundation.org:mgorman@suse.de:longman@redhat.com:hannes@cmpxchg.org:guro@fb.com:vbabka@suse.cz:khlebnikov@yandex-team.ru:jannh@google.com:songliubraving@fb.com:gregkh@linuxfoundation.org:aquini@redhat.com::linux-kernel@vger.kernel.org,RULES_HIT:41:355:379:541:800:966:967:973:988:989:1260:1263:1311:1314:1345:1437:1515:1534:1541:1711:1730:1747:1777:1792:2194:2196:2199:2200:2393:2525:2559:2564:2682:2685:2737:2859:2933:2937:2939:2942:2945:2947:2951:2954:3022:3138:3139:3140:3141:3142:3352:3865:3866:3867:3868:3870:3871:3872:3874:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4184:4250:4321:4385:5007:6119:6261:7903:8599:9015:9025:10004:10913:11658:11914:12043:12296:12297:12517:12519:12555:12663:12783:12986:13069:13161:13229:13311:13357:13846:13894:14180:14181:14384:14394:14721:14849:21060:21080:21433:21444:21627:30034:30054,0,RBL:209.85.221.68:@gmail.com:.lbl8.mailshell.net-62.18.175.100 66.100 .201.100 X-HE-Tag: corn07_3864b4b0be91b X-Filterd-Recvd-Size: 3713 Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by imf02.hostedemail.com (Postfix) with ESMTP for ; Fri, 25 Oct 2019 07:26:27 +0000 (UTC) Received: by mail-wr1-f68.google.com with SMTP id z11so1032653wro.11 for ; Fri, 25 Oct 2019 00:26:27 -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:mime-version :content-transfer-encoding; bh=yVXnrlurDnNuyFHkl/Vg0+Qizz8MAljfZrQeUc5+AOA=; b=kbLwRYIyazK/T6G5yEBjrqUSdy4l8are1PaN/t1gTFga5iouQp85rEGx5vBAhbLrz1 DV3QDh2DjQiQkP3nBGdhKFuOE1jxLZT6+yQ2qF+Brb3fha8rHz48pOxI9x4IlWR0ETDa miTgtWpP8mTmeNcFlM7elnqchZphzJJ2AuzhGM3fB14ULHg5VqLnVUENKvMPNvPw2s+F OQR1nyiDP5sW/1y+BAv3s5M7dOjiqoBWGwrtx/Rosixcf1VO2ydNkG+2XwVJRvJ2dkZB GaunNqiiTSNrp04BVnMoUlmqslO8Os2mzk2FrCWIDJ8ZjfugFhyK9gpV/Wqq5tckGhaK 1gAg== X-Gm-Message-State: APjAAAUeNARGXFUbQpr6by4RiFVFRyu5ZyjWyVtng/EAJ1mVU2WX6pdq pDDY2w9GqN1PXOz15gqheqM= X-Google-Smtp-Source: APXvYqz2Pu3ZENVB2RnwQ/z0ER/06Wuo1LBrrPn0Kr1n7nZK4fVkudnDjvJaukKp+YpQdXSxkpNtOA== X-Received: by 2002:a05:6000:11c4:: with SMTP id i4mr1415503wrx.277.1571988386382; Fri, 25 Oct 2019 00:26:26 -0700 (PDT) Received: from tiehlicka.microfocus.com (prg-ext-pat.suse.com. [213.151.95.130]) by smtp.gmail.com with ESMTPSA id x21sm1482446wmj.42.2019.10.25.00.26.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Oct 2019 00:26:24 -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 Subject: [PATCH 0/2] mm: reduce /proc/pagetypeinfo ovehead Date: Fri, 25 Oct 2019 09:26:08 +0200 Message-Id: <20191025072610.18526-1-mhocko@kernel.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Hi, Waiman Long has reported [1] that reading /proc/pagetypeinfo can severely interfere with the system and it might lead even to hard lockup detector firing up on a very large machines. Nevertheless small machines are not completely fine either because the operation requires to take the zone->lock IRQ safe spinlock and thus to interfere with both the IRQ delivery and the page allocator. The file is world readable which makes this kinda bad. The immediate danger is addressed by making the file root readable only. This is a debugging aid so general audience shouldn't require it for a general operation. This is done in the first patch. The potentially excessive time spent for free_list iteration is handled by capping the iteration loop. This should be fine for existing usecases because low numbers are usually of the primary interest. This is implemented in patch 2. I am reposting these two patches with dropped RFC (previously posted [2]) and asking for inclusion. I have also dropped Mel's Ack from the second patch because there were quite some changes since he reviewed. [1] http://lkml.kernel.org/r/20191022162156.17316-1-longman@redhat.com [2] http://lkml.kernel.org/r/20191023102737.32274-1-mhocko@kernel.org