Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp2404922ybg; Thu, 24 Oct 2019 09:12:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqz2mEuXbKYjS7yOw4VrNMWPFyGzJPxTHEBm74UAR4oaDE+Jc+hR0FPcZBrzRYwVF7KjCBSR X-Received: by 2002:a17:906:15da:: with SMTP id l26mr18352972ejd.326.1571933556212; Thu, 24 Oct 2019 09:12:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571933556; cv=none; d=google.com; s=arc-20160816; b=PncA2Jzk2YJr4cXAAe5/OlNKK40GSb7W0tKqZ/TsZ+K5iTDK++ofbtv3SoiCpUk+ie bE5oIdNMG3EJPicth8GUAaCSN0oQHTLdMcNu1o476/MVN5Sf5jmJfLhOkUsEiEjI23y4 tllIev6md6oE8f/x4kAq/k+cBRNN/3onvCwna6nGbYBNvh/fwZXSXf1MkoM211OZD9UG zSlUKW5ZRxp4XWA/KG4b9aTMcxf31ET3LcNXK0wB0ONiogf8158/rSDo/LWPxFsO4awc pIkMVlsGsEyUF6dBR05mD+elMsboIgM2CHlpJpIY9J6lnTpn5p2kPuftvrfpM2yWqsxs PLmA== 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:subject:cc:to:from:date :dkim-signature; bh=Xj4w7cfC8umb/Z/NhMD8tGjixYIc5m/SYeXJUOOMjBs=; b=cWuP2P/TOUNLf5J04IcLDfXGvFsVNRvHLzwyxFaE+O18cDuki24TjISvDd/DuAz3oZ 7ceBuv756PfZs6qGdGd+Rl03fWH9qDDbn5WJRKh8KdIsz9alpkXoAtkjprfr0pMscdGa JmeQje/aT9EagzsSziFt5bz+9zs7XZLNRfhSpM5aLdmk+QMjZlCSiV0oqNr5De2yDiep FEkdpgD5VvCh5NRKZJe9FVhN3DMR2UTnpt07y/+PXq4eaaj5rXkzRcjv9fJgY17o4jSr EWVQZkDKOCAvzRd8ekej5ksZ+AiSSaSyi3moE89zgjvXMQ0mC1PZKwg/qfrXzTDnhpnU sr4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Ro1EeVpx; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u1si3528095ejt.18.2019.10.24.09.12.12; Thu, 24 Oct 2019 09:12:36 -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=@kernel.org header.s=default header.b=Ro1EeVpx; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2407863AbfJWWan (ORCPT + 99 others); Wed, 23 Oct 2019 18:30:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:55018 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405952AbfJWWan (ORCPT ); Wed, 23 Oct 2019 18:30:43 -0400 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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!