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 4CB0CC19F2D for ; Wed, 10 Aug 2022 01:19:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C78918E0002; Tue, 9 Aug 2022 21:19:39 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BFF6C8E0001; Tue, 9 Aug 2022 21:19:39 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AA0818E0002; Tue, 9 Aug 2022 21:19:39 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 940C58E0001 for ; Tue, 9 Aug 2022 21:19:39 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 5665A1C6A2C for ; Wed, 10 Aug 2022 01:19:39 +0000 (UTC) X-FDA: 79781925678.26.DC3109A Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by imf12.hostedemail.com (Postfix) with ESMTP id 8D18340062 for ; Wed, 10 Aug 2022 01:19:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1660094378; x=1691630378; h=from:to:cc:subject:references:date:in-reply-to: message-id:mime-version; bh=HJUr0cpq2k0Fdw1RYMsCCP+3t05b3N8dkraf9iPYaxY=; b=O2DKVH39a2mdOrlDvd9l4JLsKz+ez4d+6TxKk3DUVkvX26UH2RY3JmFS JKveYVaMregBG6YsSQXsZB9u1hJ7Ka2wzXBv0yELm5bf6GXksFVZTvfIF amKqU3+1bgAbUME9Xe95JlSTrkprYUJVeMZle84XL2Ty+jM2Twke8DONV MVLcMc8dGPv7WkVFiUTT7sHbeXOo6W5U1tzJNdBdB8YrmNC0OaofU2DLA xIh27aFuuFIW7uT6qTSA1vy16P+r7isWPSn2fhXGM5VD2vcj+ewuojxoe DTnZWYfNPjxxf5FLl9YMc4Ax5RV6NXi5zb3MN82HXN+LdSUpxk856ug2h A==; X-IronPort-AV: E=McAfee;i="6400,9594,10434"; a="292218049" X-IronPort-AV: E=Sophos;i="5.93,225,1654585200"; d="scan'208";a="292218049" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Aug 2022 18:19:37 -0700 X-IronPort-AV: E=Sophos;i="5.93,225,1654585200"; d="scan'208";a="673106026" Received: from yhuang6-desk2.sh.intel.com (HELO yhuang6-desk2.ccr.corp.intel.com) ([10.238.208.55]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Aug 2022 18:19:34 -0700 From: "Huang, Ying" To: Peter Xu Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Minchan Kim , David Hildenbrand , Nadav Amit , Andrew Morton , Hugh Dickins , Vlastimil Babka , Andrea Arcangeli , Andi Kleen , "Kirill A . Shutemov" Subject: Re: [PATCH v3 2/7] mm/swap: Comment all the ifdef in swapops.h References: <20220809220100.20033-1-peterx@redhat.com> <20220809220100.20033-3-peterx@redhat.com> Date: Wed, 10 Aug 2022 09:19:31 +0800 In-Reply-To: <20220809220100.20033-3-peterx@redhat.com> (Peter Xu's message of "Tue, 9 Aug 2022 18:00:55 -0400") Message-ID: <87fsi4gajg.fsf@yhuang6-desk2.ccr.corp.intel.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=ascii ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1660094379; 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=8nXOrbwtOcTRgpg3u0lYS8sjJEblAYen/WDUqFFAs48=; b=rnsBWmnLailjfJ9pnNaArEh+OC7NmlcCzsP17hnc51ppKG84J2HA5P0aI2FX1xX80t5Px0 pkF7VxZ5ViW75+kd9mvlOpgmscZPNHR+n/yd4s+C4/psVYDR0q5uYvCDFxHNvRfQCtsD1U iJeSFkqMcYmcRbOaHCSscJwnPcbsVSI= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=none ("invalid DKIM record") header.d=intel.com header.s=Intel header.b=O2DKVH39; dmarc=pass (policy=none) header.from=intel.com; spf=pass (imf12.hostedemail.com: domain of ying.huang@intel.com designates 134.134.136.65 as permitted sender) smtp.mailfrom=ying.huang@intel.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1660094379; a=rsa-sha256; cv=none; b=eoPOT540EbdiGgbuFM4e26GuZTwYp4FDcI3E2wfLtY520qcDJq9FPyQwpxxzPoj1tz5UiS uKrnM6KTjIEbvfoYoLnbTucno5Di36JilAlJYifRQjDxrBqZZR5sA8bO4yV9sy5JhUt1tT CDUDP2uw2nUsmH0B1VGjqrvEPzNTBUE= X-Rspamd-Queue-Id: 8D18340062 Authentication-Results: imf12.hostedemail.com; dkim=none ("invalid DKIM record") header.d=intel.com header.s=Intel header.b=O2DKVH39; dmarc=pass (policy=none) header.from=intel.com; spf=pass (imf12.hostedemail.com: domain of ying.huang@intel.com designates 134.134.136.65 as permitted sender) smtp.mailfrom=ying.huang@intel.com X-Rspam-User: X-Rspamd-Server: rspam07 X-Stat-Signature: 58buo6d5ndorfrgnkt5wxo9os47nwfsz X-HE-Tag: 1660094378-73168 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: Peter Xu writes: > swapops.h contains quite a few layers of ifdef, some of the "else" and > "endif" doesn't get proper comment on the macro so it's hard to follow on > what are they referring to. Add the comments. > > Suggested-by: Nadav Amit > Signed-off-by: Peter Xu Reviewed-by: "Huang, Ying" > --- > include/linux/swapops.h | 16 ++++++++-------- > 1 file changed, 8 insertions(+), 8 deletions(-) > > diff --git a/include/linux/swapops.h b/include/linux/swapops.h > index a3d435bf9f97..3a2901ff4f1e 100644 > --- a/include/linux/swapops.h > +++ b/include/linux/swapops.h > @@ -247,8 +247,8 @@ extern void migration_entry_wait(struct mm_struct *mm, pmd_t *pmd, > #ifdef CONFIG_HUGETLB_PAGE > extern void __migration_entry_wait_huge(pte_t *ptep, spinlock_t *ptl); > extern void migration_entry_wait_huge(struct vm_area_struct *vma, pte_t *pte); > -#endif > -#else > +#endif /* CONFIG_HUGETLB_PAGE */ > +#else /* CONFIG_MIGRATION */ > static inline swp_entry_t make_readable_migration_entry(pgoff_t offset) > { > return swp_entry(0, 0); > @@ -276,7 +276,7 @@ static inline void migration_entry_wait(struct mm_struct *mm, pmd_t *pmd, > #ifdef CONFIG_HUGETLB_PAGE > static inline void __migration_entry_wait_huge(pte_t *ptep, spinlock_t *ptl) { } > static inline void migration_entry_wait_huge(struct vm_area_struct *vma, pte_t *pte) { } > -#endif > +#endif /* CONFIG_HUGETLB_PAGE */ > static inline int is_writable_migration_entry(swp_entry_t entry) > { > return 0; > @@ -286,7 +286,7 @@ static inline int is_readable_migration_entry(swp_entry_t entry) > return 0; > } > > -#endif > +#endif /* CONFIG_MIGRATION */ > > typedef unsigned long pte_marker; > > @@ -426,7 +426,7 @@ static inline int is_pmd_migration_entry(pmd_t pmd) > { > return is_swap_pmd(pmd) && is_migration_entry(pmd_to_swp_entry(pmd)); > } > -#else > +#else /* CONFIG_ARCH_ENABLE_THP_MIGRATION */ > static inline int set_pmd_migration_entry(struct page_vma_mapped_walk *pvmw, > struct page *page) > { > @@ -455,7 +455,7 @@ static inline int is_pmd_migration_entry(pmd_t pmd) > { > return 0; > } > -#endif > +#endif /* CONFIG_ARCH_ENABLE_THP_MIGRATION */ > > #ifdef CONFIG_MEMORY_FAILURE > > @@ -495,7 +495,7 @@ static inline void num_poisoned_pages_sub(long i) > atomic_long_sub(i, &num_poisoned_pages); > } > > -#else > +#else /* CONFIG_MEMORY_FAILURE */ > > static inline swp_entry_t make_hwpoison_entry(struct page *page) > { > @@ -514,7 +514,7 @@ static inline void num_poisoned_pages_inc(void) > static inline void num_poisoned_pages_sub(long i) > { > } > -#endif > +#endif /* CONFIG_MEMORY_FAILURE */ > > static inline int non_swap_entry(swp_entry_t entry) > {