lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YZKEyrrH4SjqV8W7@casper.infradead.org>
Date:   Mon, 15 Nov 2021 16:03:22 +0000
From:   Matthew Wilcox <willy@...radead.org>
To:     Christoph Hellwig <hch@...radead.org>
Cc:     "Darrick J . Wong " <djwong@...nel.org>, linux-xfs@...r.kernel.org,
        linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-block@...r.kernel.org, Jens Axboe <axboe@...nel.dk>
Subject: Re: [PATCH v2 04/28] fs: Rename AS_THP_SUPPORT and
 mapping_thp_support

On Tue, Nov 09, 2021 at 12:41:19AM -0800, Christoph Hellwig wrote:
> On Mon, Nov 08, 2021 at 04:05:27AM +0000, Matthew Wilcox (Oracle) wrote:
> > These are now indicators of multi-page folio support, not THP support.
> 
> Given that we don't use the large foltio term anywhere else this really
> needs to grow a comment explaining what the flag means.

I think I prefer the term 'large' to 'multi'.  What would you think to
this patch (not on top of any particular branch; just to show the scope
of it ...)

+++ b/include/linux/page-flags.h
@@ -692,7 +692,7 @@ static inline bool folio_test_single(struct folio *folio)
        return !folio_test_head(folio);
 }

-static inline bool folio_test_multi(struct folio *folio)
+static inline bool folio_test_large(struct folio *folio)
 {
        return folio_test_head(folio);
 }
+++ b/mm/filemap.c
@@ -192,9 +192,9 @@ static void filemap_unaccount_folio(struct address_space *mapping,
        __lruvec_stat_mod_folio(folio, NR_FILE_PAGES, -nr);
        if (folio_test_swapbacked(folio)) {
                __lruvec_stat_mod_folio(folio, NR_SHMEM, -nr);
-               if (folio_test_multi(folio))
+               if (folio_test_large(folio))
                        __lruvec_stat_mod_folio(folio, NR_SHMEM_THPS, -nr);
-       } else if (folio_test_multi(folio)) {
+       } else if (folio_test_large(folio)) {
                __lruvec_stat_mod_folio(folio, NR_FILE_THPS, -nr);
                filemap_nr_thps_dec(mapping);
        }
@@ -236,7 +236,7 @@ void filemap_free_folio(struct address_space *mapping, struct folio *folio)
        if (freepage)
                freepage(&folio->page);

-       if (folio_test_multi(folio) && !folio_test_hugetlb(folio)) {
+       if (folio_test_large(folio) && !folio_test_hugetlb(folio)) {
                folio_ref_sub(folio, folio_nr_pages(folio));
                VM_BUG_ON_FOLIO(folio_ref_count(folio) <= 0, folio);
        } else {
+++ b/mm/memcontrol.c
@@ -5558,7 +5558,7 @@ static int mem_cgroup_move_account(struct page *page,

        VM_BUG_ON(from == to);
        VM_BUG_ON_FOLIO(folio_test_lru(folio), folio);
-       VM_BUG_ON(compound && !folio_test_multi(folio));
+       VM_BUG_ON(compound && !folio_test_large(folio));

        /*
         * Prevent mem_cgroup_migrate() from looking at

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ