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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 654EDC433F5 for ; Fri, 4 Mar 2022 21:17:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7A7B28D0002; Fri, 4 Mar 2022 16:17:33 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 757768D0001; Fri, 4 Mar 2022 16:17:33 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 645F18D0002; Fri, 4 Mar 2022 16:17:33 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.a.hostedemail.com [64.99.140.24]) by kanga.kvack.org (Postfix) with ESMTP id 560F58D0001 for ; Fri, 4 Mar 2022 16:17:33 -0500 (EST) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 140F3234E2 for ; Fri, 4 Mar 2022 21:17:33 +0000 (UTC) X-FDA: 79207965186.05.0173EFF Received: from mail-qk1-f176.google.com (mail-qk1-f176.google.com [209.85.222.176]) by imf22.hostedemail.com (Postfix) with ESMTP id 9D06FC001E for ; Fri, 4 Mar 2022 21:17:32 +0000 (UTC) Received: by mail-qk1-f176.google.com with SMTP id q4so7440917qki.11 for ; Fri, 04 Mar 2022 13:17:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:in-reply-to:message-id:references :mime-version; bh=K7s2cmmk7Zg+rBGEFOdp9bOvWs4Cpnx7T7LFDlbjDDI=; b=NM06JldRsvN5yOo5aVlrIGwoeXFHRza3IRXqmQgmSFRdqRRZz8cb8kYdOEBCGC/oTD CrLX8zKRFgQ+lpMsCoD3Fj5FWgxIQUK8PcaiOj9JbTZbFJJDB4af8KRp/j1V/QbVFJQN VILc9J7ZsRGj5pExFgmGr6gqmR5mDjXsYBJlF0i1tCH5isIzCrGmF7IqKnNLgFeH5m/Q ojmNDqDwoDJadwvgV1Ruu1uJPsCFJgWFeasmLlzSFB+qLm91F7hTLq5Xyi8NHf5ABkTk kl/o1T928AesayH/2KclMaBvPcpasVbva4wh8uGwsCi3Z/1L0O8Ul6VzHqAe3ddaxXFp NdTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:mime-version; bh=K7s2cmmk7Zg+rBGEFOdp9bOvWs4Cpnx7T7LFDlbjDDI=; b=vDekILWdBhWOhyJURj/dhB3EtOlkG1yayLJatqsLi3M4DLNRGZ0cV9K0a3QNeANfho y8PygeXl9yod1Zj3hvxC/pzK514QXPq0noNmKAbn9FFieG7/kwjyRVsCfZwA4RHKlFx8 GBtwUU/f5IFQnpH+2/tLtvEJ+2/L7DGL2Ci6o8/7vZaVceor+yEjEp1Y0n9wL4TA0jRh AuG3p4bRg+IkRRnF6/C/liUtQ/So9r+0D0jn1BBbi1EjUrbo/pN6+F8ht1tWgGS08FlS NYFM4i66XsM9AlFMsbANq0BU5+BxV0yrcXtLsZTvCwmKGbwTpU7heyGRqwuZZjX/IepP NFNQ== X-Gm-Message-State: AOAM530VtVgSZFRquaauwTxUi5u8CpK3DSMXdbq2IGQ55Di18v7rzozQ Bk/9Jqlx+GKWY1T2CzlGMz8gXg== X-Google-Smtp-Source: ABdhPJzvawwGSPRBEMdoX1Rm2eL5dwC68GJUJnEWjdQXlC41Os+q5QY5QNd7/CvMGUtsRhnUkz/ceg== X-Received: by 2002:a05:620a:1005:b0:640:7d6f:cacf with SMTP id z5-20020a05620a100500b006407d6fcacfmr374537qkj.557.1646428651714; Fri, 04 Mar 2022 13:17:31 -0800 (PST) Received: from ripple.attlocal.net (172-10-233-147.lightspeed.sntcca.sbcglobal.net. [172.10.233.147]) by smtp.gmail.com with ESMTPSA id z196-20020a3765cd000000b0050848cdb596sm2956151qkb.101.2022.03.04.13.17.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Mar 2022 13:17:31 -0800 (PST) Date: Fri, 4 Mar 2022 13:17:21 -0800 (PST) From: Hugh Dickins X-X-Sender: hugh@ripple.anvils To: David Hildenbrand cc: Hugh Dickins , Andrew Morton , Matthew Wilcox , Nicholas Piggin , Yu Zhao , Yang Shi , Michal Hocko , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH mmotm] mm: delete __ClearPageWaiters() In-Reply-To: <90aafe84-fe7d-c70e-8e15-c222869f30fc@redhat.com> Message-ID: <6e5262ff-8596-a86-7388-eddb2b2c53c@google.com> References: <351df0af-78f2-c20-2a6d-e5f978e5ca1@google.com> <9dda55d5-eafa-3177-2a4c-32ccb7e146e3@google.com> <90aafe84-fe7d-c70e-8e15-c222869f30fc@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 9D06FC001E X-Stat-Signature: 4uhh1yw76xjqtxhc9o3fzi9wyxqqu9b3 Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=NM06JldR; spf=pass (imf22.hostedemail.com: domain of hughd@google.com designates 209.85.222.176 as permitted sender) smtp.mailfrom=hughd@google.com; dmarc=pass (policy=reject) header.from=google.com X-Rspam-User: X-HE-Tag: 1646428652-885458 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 Fri, 4 Mar 2022, David Hildenbrand wrote: > > In this context we can consider ZONE_DEVICE pages just like any other > pages that, although getting freed, are not returned to the buddy, but > instead are returned to another pool. So PAGE_FLAGS_CHECK_AT_PREP won't > apply and free_pages_prepare() won't apply. > > Another example would be hugetlb pages, that are returned to the hugetlb > pool, but not back to the buddy unless the huge page pool is shrunk. > > > So I feel like the underlying principle here is: we don't *care* if > PG_waiter is cleared when a page gets freed, because it will simply get > cleared by the next waker if it sticks around. I think we were focused on different issues here. I was focused on how it was redundant for those places to clear the bit, because it was going to get cleared anyway just after (in the buddy case). Whereas you are focused on how it doesn't matter at all whether it gets cleared when freeing. Both valid points. > > Then, I agree, we can just drop the comment regarding > PAGE_FLAGS_CHECK_AT_PREP and instead have something like Okay, the reference to PAGE_FLAGS_CHECK_AT_PREP in the commit message is good enough for me, no need to make a point of it in the code comment. > > > " > That's okay, it's a rare case and the next waker will just clear it. > Note that, depending on the page pool (buddy, ZONE_DEVICE, hugetlb), we > might clear the flag while freeing the page, however, this is not > required for correctness. > " Okay, v2 coming up: I've taken largely your wording (but not exactly). Thanks, Hugh