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 7041CC43334 for ; Fri, 24 Jun 2022 17:09:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E5B558E0239; Fri, 24 Jun 2022 13:09:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E0A6D8E020E; Fri, 24 Jun 2022 13:09:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CD2668E0239; Fri, 24 Jun 2022 13:09:17 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id C03028E020E for ; Fri, 24 Jun 2022 13:09:17 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 7D335315F3 for ; Fri, 24 Jun 2022 17:09:16 +0000 (UTC) X-FDA: 79613765112.06.8C75C68 Received: from mail-pg1-f170.google.com (mail-pg1-f170.google.com [209.85.215.170]) by imf27.hostedemail.com (Postfix) with ESMTP id 1800140032 for ; Fri, 24 Jun 2022 17:09:15 +0000 (UTC) Received: by mail-pg1-f170.google.com with SMTP id q140so2976419pgq.6 for ; Fri, 24 Jun 2022 10:09:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=+34mV2GgOppVanfZ9ynO37pzqtHQm+7qlycXpXslgnM=; b=eMygqP5xYgaPLOrAm2dSertr6ihOdd7ZvWCAapgpBZ5NGgsxm/XETmCXorvfWcoQOa J07BzPskgHYbp428pfpLncjWWyxRqwi/3bRdXq0PAYfYSHUYqSAHylMdzhKNI4CHP5lu SBUWGbKnLZ2SJY7ql1yURDYn4LDJuWD3J1PTRyc6yBnFv1jX51anuxioeWgjS0NJgZU0 2N1GUX6XYwjZLQSjl2pCt8viM3TThqv/uZwWBUZxClSDYXSns25C+/gOJwOHYl0dNFJg TN65G2VGP5/xVwrLLc6EWoJxzjKf9FicEyu6FPiO/TFIQelbygVU3kMesI4AaEosYDH4 IICw== 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:message-id:references :mime-version:content-disposition:in-reply-to; bh=+34mV2GgOppVanfZ9ynO37pzqtHQm+7qlycXpXslgnM=; b=U85lQgpKz2J/wDK0GPOheEWGUZmpB/GF8TXqLlkCG8pZuCvxoVadIQsIMKGMBzYtp6 H97dBIdAqDgYRIxt4bBaf1KuK1DJ2meSW1tyfb9LqMwWP80ju/GC3mN0pmxm0CojnIld S8ocuL1lDx/DWr8do09nCK4Sd2kf2llnvNJG+UwwAArBZl2R2e0jy6dcLgNQVL69xX+F nyL/BoUBCyy07tuUx/DRnC0IQVV5IVDn67XLZckamIwjkbMv4PRUgWtRthWaMFPse1hC NwrbP0jeQSlp3HKoyNkBa2wDLkYBcPj8dgJXrblTXkCKBLtZwRLO+SAYI2X/6kUqT9Wh ONlA== X-Gm-Message-State: AJIora9cHXA44PLNf6/4sujk+PnbzxoNszKBY9YdudDOWCeOszMvjlj1 gV3VcyOD2QDXhUb2PSNrQI4xEQ== X-Google-Smtp-Source: AGRyM1sFfGPH+nQhntZBQ49g61G9RcFCMhhpVE3+mKE6QpMSt17EeuUnHDPLfMigz6YbdEvv1IP64g== X-Received: by 2002:aa7:86c9:0:b0:525:3d39:8d0f with SMTP id h9-20020aa786c9000000b005253d398d0fmr170020pfo.54.1656090554666; Fri, 24 Jun 2022 10:09:14 -0700 (PDT) Received: from google.com (55.212.185.35.bc.googleusercontent.com. [35.185.212.55]) by smtp.gmail.com with ESMTPSA id jj22-20020a170903049600b001674d61c1c6sm2023237plb.272.2022.06.24.10.09.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jun 2022 10:09:13 -0700 (PDT) Date: Fri, 24 Jun 2022 10:09:09 -0700 From: Zach O'Keefe To: Miaohe Lin Cc: Muchun Song , akpm@linux-foundation.org, shy828301@gmail.com, willy@infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 14/16] mm/huge_memory: fix comment of page_deferred_list Message-ID: References: <20220622170627.19786-1-linmiaohe@huawei.com> <20220622170627.19786-15-linmiaohe@huawei.com> <0b1a1633-2e07-87df-b707-3058353f5609@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0b1a1633-2e07-87df-b707-3058353f5609@huawei.com> ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1656090556; a=rsa-sha256; cv=none; b=VFB/QMaejAaG9sbpBE1bGaTGIVrNBmW6GLw0q5rz6ZuRcLtnl44HBmJ4/c8T97BTyn4p2J /+Gv8BospjsnKhePHfQ3yyOiyd8MfaQfPqA5nJOJ+pI1xXAIFbGeRujleVzyDLVu6+5KF/ URUxUo8gR8jUczW/O6uFWwqwFIS+VXA= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=eMygqP5x; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf27.hostedemail.com: domain of zokeefe@google.com designates 209.85.215.170 as permitted sender) smtp.mailfrom=zokeefe@google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1656090556; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=+34mV2GgOppVanfZ9ynO37pzqtHQm+7qlycXpXslgnM=; b=J7sYlwElmGQPiv/A+gSOIyVx43mcoF9Y4pYJxgVGPy3+/Z8nCHXaocq/UYycSXuvd0dH3h 16f2myhjcQICNDXX/DYL7j3YVLr3KWm6mQXQXymFxgxK45NlrkXI28yfWAH+PyUJjYNqYY 6vWUwQPE48oBmtutmA3U/bdSh+pzcf8= X-Rspam-User: X-Stat-Signature: 5eeirg35mohqjc6qm4d8u8pfipfe86za X-Rspamd-Queue-Id: 1800140032 Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=eMygqP5x; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf27.hostedemail.com: domain of zokeefe@google.com designates 209.85.215.170 as permitted sender) smtp.mailfrom=zokeefe@google.com X-Rspamd-Server: rspam03 X-HE-Tag: 1656090555-86189 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 23 Jun 20:26, Miaohe Lin wrote: > On 2022/6/23 15:24, Muchun Song wrote: > > On Thu, Jun 23, 2022 at 01:06:25AM +0800, Miaohe Lin wrote: > >> The current comment is confusing because if global or memcg deferred list > >> in the second tail page is occupied by compound_head, why we still use > >> page[2].deferred_list here? I think it wants to say that Global or memcg > >> deferred list in the first tail page is occupied by compound_mapcount and > >> compound_pincount so we use the second tail page's deferred_list instead. > >> > >> Signed-off-by: Miaohe Lin > >> --- > >> include/linux/huge_mm.h | 4 ++-- > >> 1 file changed, 2 insertions(+), 2 deletions(-) > >> > >> diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h > >> index 12b297f9951d..2e8062b3417a 100644 > >> --- a/include/linux/huge_mm.h > >> +++ b/include/linux/huge_mm.h > >> @@ -294,8 +294,8 @@ static inline bool thp_migration_supported(void) > >> static inline struct list_head *page_deferred_list(struct page *page) > >> { > >> /* > >> - * Global or memcg deferred list in the second tail pages is > >> - * occupied by compound_head. > >> + * Global or memcg deferred list in the first tail page is > >> + * occupied by compound_mapcount and compound_pincount. > >> */ > > > > The structure of "struct page" seems to have told us the information that > > we resue the 2nd tail page to be used as deferred_list. I am not sure the > > Yes, it does. > > > value of those comments. Maybe better to remove them? > > IMHO above comment tries to tell us why deferred list in the second tail page is used > instead of first tail page. But it should be fine to remove the above comments as they > don't seem to provide much info (thought I'm not really sure). > > Thanks. > Just a suggestion - feel free to disregard. Maybe we don't need to repeat the comments in struct page, but maybe a "see organization of tail pages of compound page in "struct page" definition" would at least point new people to where this magic 2 comes from. Maybe an obvious place to check after you're familiar with overloading struct page data for compound pages - but IMO it's not obvious for newcomers. > > > > Thanks. > > > >> return &page[2].deferred_list; > >> } > >> -- > >> 2.23.0 > >> > >> > > . > > >