Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp851582pxa; Wed, 19 Aug 2020 17:17:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzUPN1WzE+u6p1YMymZ6WZ9qxdyaAdkUlW87nDfYtvFI3Mw1Oa+XHBQzZaLFDLLXwhwRFpS X-Received: by 2002:a17:907:10db:: with SMTP id rv27mr802156ejb.350.1597882679705; Wed, 19 Aug 2020 17:17:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597882679; cv=none; d=google.com; s=arc-20160816; b=pd2Y4zXwnxY9ZQepSUOG0CCgfqr8g7abh0zozWK3sET8rbchP+hvosXpHlAH54F7RF yTSv9HgsABNUOy4s/R3ya5F9ZbVxDewr9z3RGIOO/y3CO3mdwZhte51rTyzfXfChDKCl MlsVfT9cgW7zlr4CEDcNpHTPvoc2hVp9gcfZNVB3F7QlArd5RhzHnUyVKaR44qj5nzBJ Qp3mGRjw0ELetIfBoi+D6jHAN7VlPjNB/+0Q/ZE/cUNpJaSZttG886AX2WNH+bIhpgSr ZFU1beXWFZ4x8Zdq2QZCGfVHRaHCoZWY+Tu/lcnftSXxm59LT0wgT6tGxe6ZxrHGhJ/O DVaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=dD6I2sfjrM7WmVDgF13oHi2u8mSy5yR9cY0JUVIH+rg=; b=0nMosgyFc784zHUH0cXfqAWGOdoy8miHAx7P/VG8Tnqobx1dhEO7w0VYcQV19quBK/ X6NusNJR5DJHqFbOIj4/viuhjknEMQCt5CjIbVDEiFlyd18IHspCDeek/ByouW7pr+Wh xCz3qxDt8SmHFSo7o8ffZwy/+W21rfvdG8Uui2/34GhfwnblQrBYv7VRz1ers4dRw3oV COxiWPSQA1IfM5c6+S5K+ECm35f38l/7qLndAOQ9/ngtYBLonuoX6bAdYVu7fadeJoYU F6ThcNMkVid0QmZrp7A4xnCQbmnNLRpQ6mnfgh9KJx03s/y5h42at38FrykigovUSAX8 o15A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=i3LLQUZx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x25si304535edq.539.2020.08.19.17.17.36; Wed, 19 Aug 2020 17:17:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=i3LLQUZx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726803AbgHTARD (ORCPT + 99 others); Wed, 19 Aug 2020 20:17:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726482AbgHTARC (ORCPT ); Wed, 19 Aug 2020 20:17:02 -0400 Received: from mail-ej1-x641.google.com (mail-ej1-x641.google.com [IPv6:2a00:1450:4864:20::641]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 278C0C061757 for ; Wed, 19 Aug 2020 17:17:02 -0700 (PDT) Received: by mail-ej1-x641.google.com with SMTP id m22so512421eje.10 for ; Wed, 19 Aug 2020 17:17:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=dD6I2sfjrM7WmVDgF13oHi2u8mSy5yR9cY0JUVIH+rg=; b=i3LLQUZx4nyJ5d3l3nMcnG3nuuf4pMY9IuD04004diC+RW1FBhhynk1uN1fkT+YHlj O6P89P2/0ljvDOBC4J31KdqlQsnHRXQnE3uid+q4MwfgQcj/wP/GqimWxkiJTwp1Yqzf DZ0pReM1kOawPpkXd0EvzBYaXrm29/9NESxqmy8LfWWl0pHJlQaskSNKhEIyBEkQTb9s QCaYqGwnG0A1sASXMGdjgMBMvK2BtabJJA0fd1TcWDz1jC/3BiNg49IBam5xM70JJyBu fEGNrRQ13xxWO/DhqsbW+mXazfEuJs+GEP+UC3kUyhQdRV8mzqHCYuHGFPNSmdrIGvFz ++Gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=dD6I2sfjrM7WmVDgF13oHi2u8mSy5yR9cY0JUVIH+rg=; b=CQaTlPvV7vMJewvYVPxRDISrB4pHn/ZIedQnazl3ZRgUxw3OjPHrSx5rUgKDdrtqcQ 1nyfKXE86pTRsMS8gt8hF+NnL5uBTxlr2YtJj6PAYp322JNJ1P+i2myL6Cqbu0LIVxPF 6gM3MZDne3B3NJDohN5JF62kRycBrqFlUDW15xjLStQyzaJIQ1Lhx7tG1FXzXnbYUmxC 0q6URRcyYEwvpzi1KEfNBAsRAVCDrdg7bMqnDkzgAM5LFrdTY/34+ROsv97eOrrhttlQ qBJo8S91laQ9yesTqJy+vNEnd+Dcck+HnkkMXtIpFctfySbAAcejDCONL4hCFEuogSi8 9bmQ== X-Gm-Message-State: AOAM530kHPF2u8CM8xj33bI3Xy1PXXyCLIzY0+m8okm+/M1zbKeDR+Vz uqAnON8HC+fpd1Uu3wLuF1k9bjhIsTrgD13c/4g= X-Received: by 2002:a17:906:3993:: with SMTP id h19mr820232eje.111.1597882620894; Wed, 19 Aug 2020 17:17:00 -0700 (PDT) MIME-Version: 1.0 References: <20200818184704.3625199-1-yuzhao@google.com> <20200818184704.3625199-3-yuzhao@google.com> <20200819233916.GA2021304@google.com> In-Reply-To: <20200819233916.GA2021304@google.com> From: Yang Shi Date: Wed, 19 Aug 2020 17:16:49 -0700 Message-ID: Subject: Re: [PATCH v2 3/3] mm: remove superfluous __ClearPageWaiters() To: Yu Zhao Cc: Andrew Morton , Alexander Duyck , Huang Ying , David Hildenbrand , Michal Hocko , Yang Shi , Qian Cai , Mel Gorman , Nicholas Piggin , =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , Hugh Dickins , Linux MM , Linux Kernel Mailing List , Joonsoo Kim Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 19, 2020 at 4:39 PM Yu Zhao wrote: > > On Wed, Aug 19, 2020 at 04:06:32PM -0700, Yang Shi wrote: > > On Tue, Aug 18, 2020 at 11:47 AM Yu Zhao wrote: > > > > > > Presumably __ClearPageWaiters() was added to follow the previously > > > removed __ClearPageActive() pattern. > > > > > > Only flags that are in PAGE_FLAGS_CHECK_AT_FREE needs to be properly > > > cleared because otherwise we think there may be some kind of leak. > > > PG_waiters is not one of those flags and leaving the clearing to > > > PAGE_FLAGS_CHECK_AT_PREP is more appropriate. > > > > Actually TBH I'm not very keen to this change, it seems the clearing > > is just moved around and the allocation side pays for that instead of > > free side. > > I'll assume you are referring to the overhead from clearing > PG_waiters. First of all, there is no overhead -- we should have a > serious talk with the hardware team who makes word-size bitwise AND > more than one instruction. And the clearing is done in > free_pages_prepare(), which has nothing to do with allocations. Oh, yes, you are right. Now I'm wondering why we have the waiter bit cleared at the first place.