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=-11.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FSL_HELO_FAKE, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL 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 91B85C433E1 for ; Wed, 19 Aug 2020 23:39:24 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 454DF2076E for ; Wed, 19 Aug 2020 23:39:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="sLIfSR7e" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 454DF2076E Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id B00DA6B0062; Wed, 19 Aug 2020 19:39:23 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AB1286B008C; Wed, 19 Aug 2020 19:39:23 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9A00F6B0093; Wed, 19 Aug 2020 19:39:23 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0088.hostedemail.com [216.40.44.88]) by kanga.kvack.org (Postfix) with ESMTP id 858626B0062 for ; Wed, 19 Aug 2020 19:39:23 -0400 (EDT) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 41A73180AD81A for ; Wed, 19 Aug 2020 23:39:23 +0000 (UTC) X-FDA: 77168937006.07.bulb32_3e08f0f2702c Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin07.hostedemail.com (Postfix) with ESMTP id 1A0DC1803F9AE for ; Wed, 19 Aug 2020 23:39:23 +0000 (UTC) X-HE-Tag: bulb32_3e08f0f2702c X-Filterd-Recvd-Size: 4507 Received: from mail-io1-f68.google.com (mail-io1-f68.google.com [209.85.166.68]) by imf47.hostedemail.com (Postfix) with ESMTP for ; Wed, 19 Aug 2020 23:39:22 +0000 (UTC) Received: by mail-io1-f68.google.com with SMTP id b16so528949ioj.4 for ; Wed, 19 Aug 2020 16:39:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=m4rVil/+BbCJUuTNwOMLbJlYA+TW6cPNzlaZT6ijW5A=; b=sLIfSR7eZvFjgKSgew6xoITS6aRH/TGBeFWD14D5ilcTkdapcrGn5yYceeXLf/xtpk vKFRHKYWD6dYP+aSUxNcnaoCdeAEDwY4HoGHUhk/VYzhqnPrOPZk+cesdV1gu8N5LOiV T37x+a5HZ8RREy16jMqs4I9SxxlQbvA4EyahEtfk0I3SOj3kBGnIVpGY0As84/hTfJ8W zhSFdzf7kVlvGICF/r5Bw3cLHDt/sEYa1cphUh3OaFXRr86pruO/NElZfPGe97KZWRsC BJd3v6k9jyi3SkCXsuhL/bumNA+wrVz6Sj++vJnQ2fYsS3t+Tdpp2LRSDw+VwSwzAAxL 7MsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=m4rVil/+BbCJUuTNwOMLbJlYA+TW6cPNzlaZT6ijW5A=; b=pUHQtZlKZt6q5nST1R0Er2piaRlDvVfSGAs4DnZPtu/9hfnW/XAexuGW+kL4VeU7Mf YU1fRwLlrfJWBwbmk/Nr904QFHEyPeKO4yFoChJEV/U8dRZW1McgYF0kAa3k9oXGQ557 IuksfXtSkay7pqiU1zQ6m0xPFxLyWxHFmEilBRuMkBQhIcHKRl6FQLpP44ED+iXnsMpB YSgZmcDq3LmuB7jYNd/4s0yD9I/Wwwu27YSk+6Z55ujcSEHlMLd9Z7WqwCQyLFRkyJdD 21z7Vbyh45+NkMhJaoKG6Ykau/AMKPGBq+uD4RTQc3RhIe4vX2ZOOnLje1T2rreIl8hx jr/A== X-Gm-Message-State: AOAM530cFoBGUV1+qnnLDr5LtEoupZx7jv5Q5KaxGRzpJu8ggf4EziJ7 q7eq3kMiyR2ZX6JtCx1XDDe0SA== X-Google-Smtp-Source: ABdhPJwl9UuZYqWa4keqdy8S8v+a7xvgLMO8aOmJLjnjXoH8lmQjKvGVZDrWAI9CHWEfsdFidc/0ig== X-Received: by 2002:a02:a302:: with SMTP id q2mr741415jai.102.1597880361716; Wed, 19 Aug 2020 16:39:21 -0700 (PDT) Received: from google.com ([2620:15c:183:200:7220:84ff:fe09:2d90]) by smtp.gmail.com with ESMTPSA id o1sm366203ils.1.2020.08.19.16.39.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Aug 2020 16:39:20 -0700 (PDT) Date: Wed, 19 Aug 2020 17:39:16 -0600 From: Yu Zhao To: Yang Shi Cc: Andrew Morton , Alexander Duyck , Huang Ying , David Hildenbrand , Michal Hocko , Yang Shi , Qian Cai , Mel Gorman , Nicholas Piggin , =?iso-8859-1?B?Suly9G1l?= Glisse , Hugh Dickins , Linux MM , Linux Kernel Mailing List , Joonsoo Kim Subject: Re: [PATCH v2 3/3] mm: remove superfluous __ClearPageWaiters() Message-ID: <20200819233916.GA2021304@google.com> References: <20200818184704.3625199-1-yuzhao@google.com> <20200818184704.3625199-3-yuzhao@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 1A0DC1803F9AE X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam03 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 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.