From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3D1C6CA9EB9 for ; Wed, 23 Oct 2019 22:30:44 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id F16F42064A for ; Wed, 23 Oct 2019 22:30:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="Ro1EeVpx" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F16F42064A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 82A366B0003; Wed, 23 Oct 2019 18:30:43 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7DB0E6B0006; Wed, 23 Oct 2019 18:30:43 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6F0176B0007; Wed, 23 Oct 2019 18:30:43 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0162.hostedemail.com [216.40.44.162]) by kanga.kvack.org (Postfix) with ESMTP id 4D6B66B0003 for ; Wed, 23 Oct 2019 18:30:43 -0400 (EDT) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with SMTP id D777A8150 for ; Wed, 23 Oct 2019 22:30:42 +0000 (UTC) X-FDA: 76076495124.09.pet52_7a98b4ee60605 X-HE-Tag: pet52_7a98b4ee60605 X-Filterd-Recvd-Size: 3179 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf26.hostedemail.com (Postfix) with ESMTP for ; Wed, 23 Oct 2019 22:30:42 +0000 (UTC) Received: from akpm3.svl.corp.google.com (unknown [104.133.8.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E159E205F4; Wed, 23 Oct 2019 22:30:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571869841; bh=DWYa+x0xITM9x5wWaEuEOfOVystvbEdQhFiEO2C4nug=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Ro1EeVpxrO5SIABm2XMFzd+1A3Hs7vUtQSbjUTQneiaoSYyxXKyDcXhVU9MLn/cun +Txt75/UI6hdcK8IC0nlOtxvpX5xXqCTUatAcX/AF7o1JSn+1sXMigEF8fDQ1p0tYO Rb1a3EToiaRUk9iIugb2w7CdCN90dZW4Gikl4dzM= Date: Wed, 23 Oct 2019 15:30:40 -0700 From: Andrew Morton To: Waiman Long Cc: Qian Cai , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Johannes Weiner , Michal Hocko , Roman Gushchin , Vlastimil Babka , Konstantin Khlebnikov , Jann Horn , Song Liu , Greg Kroah-Hartman , Rafael Aquini Subject: Re: [PATCH] mm/vmstat: Reduce zone lock hold time when reading /proc/pagetypeinfo Message-Id: <20191023153040.c7fff4bc7c86ed605fc4667f@linux-foundation.org> In-Reply-To: References: <20191022162156.17316-1-longman@redhat.com> <20191022145902.d9c4a719c0b32175e06e4eee@linux-foundation.org> <2236495a-ead0-e08e-3fb6-f3ab906b75b6@redhat.com> <1571842093.5937.84.camel@lca.pw> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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: On Wed, 23 Oct 2019 11:01:04 -0400 Waiman Long wrote: > On 10/23/19 10:48 AM, Qian Cai wrote: > >>> this still isn't a bulletproof fix. Maybe just terminate the list > >>> walk if freecount reaches 1024. Would anyone really care? > >>> > >>> Sigh. I wonder if anyone really uses this thing for anything > >>> important. Can we just remove it all? > >>> > >> Removing it will be a breakage of kernel API. > > Who cares about breaking this part of the API that essentially nobody will use > > this file? > > > There are certainly tools that use /proc/pagetypeinfo and this is how > the problem is found. I am not against removing it, but we have to be > careful and deprecate it in way that minimize user impact. Yes, removing things is hard. One approach is to add printk_once(this is going away, please email us if you use it) then wait a few years. Backport that one-liner into -stable kernels to hopefully speed up the process. Meanwhile, we need to fix the DoS opportunity. How about my suggestion that we limit the count to 1024, see if anyone notices? I bet they don't!