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=-3.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, 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 F0E14C433E1 for ; Thu, 20 Aug 2020 00:17:03 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id AD962207FB for ; Thu, 20 Aug 2020 00:17:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="i3LLQUZx" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AD962207FB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 34FCE6B0088; Wed, 19 Aug 2020 20:17:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 300246B0089; Wed, 19 Aug 2020 20:17:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 216698D0001; Wed, 19 Aug 2020 20:17:03 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0141.hostedemail.com [216.40.44.141]) by kanga.kvack.org (Postfix) with ESMTP id 0F3896B0088 for ; Wed, 19 Aug 2020 20:17:03 -0400 (EDT) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id BE6411E00 for ; Thu, 20 Aug 2020 00:17:02 +0000 (UTC) X-FDA: 77169031884.23.mark75_21155b92702c Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin23.hostedemail.com (Postfix) with ESMTP id 9156437604 for ; Thu, 20 Aug 2020 00:17:02 +0000 (UTC) X-HE-Tag: mark75_21155b92702c X-Filterd-Recvd-Size: 4404 Received: from mail-ej1-f67.google.com (mail-ej1-f67.google.com [209.85.218.67]) by imf22.hostedemail.com (Postfix) with ESMTP for ; Thu, 20 Aug 2020 00:17:02 +0000 (UTC) Received: by mail-ej1-f67.google.com with SMTP id a26so563792ejc.2 for ; Wed, 19 Aug 2020 17:17:01 -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=T2d52kgy1Jn5KI4J1tkn65RtwjObAemLmq8g2dzqp0JJR2n8OZfr9lqhW/WBhvaT7a RN+omhx31WVqF+GIORYGJ6mB4F74N0xBc6O3V1JLLKwlBANu7SMk6b8gFttWCw/OvIhW Y79Gytl9WopctTuzyrqCbt6EO6fkw0piVk0tiXUUeWoSy/enhoU7GJqFH3yNZVlmCGk5 eradym6ydFO/Y7L0Q4uQOTa/GIWuNBo6jo/3yh9YRjLkxSM+Nz7yz3ppdbuUwTbGf8RG Ng5FzsbCN+TJ4gprs+KlX10LAbVIcdmSPXQqS+xG2OV/Dil2UtzubG2TttR1TYp1cfhr vnvg== X-Gm-Message-State: AOAM5321EpCVgvlJGOU4HNxeHlqrUnUjSC3WLoe042+kSmI9Hiuz40QU 2d4RDNekKWNDlQLuU9f3Q5ryoaE9JmSZuqECWIs= X-Google-Smtp-Source: ABdhPJyjCrNJBANQhRcSAYN+Gm3Pz8l0tivSgen+dDxeCEI/OYPauzv88z3LE98Jev+9tp0teLzTi4suRmxRX+BZJU8= 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" X-Rspamd-Queue-Id: 9156437604 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam02 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, 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.