linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Ryan Roberts <ryan.roberts@arm.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	David Hildenbrand <david@redhat.com>,
	Matthew Wilcox <willy@infradead.org>,
	Huang Ying <ying.huang@intel.com>, Gao Xiang <xiang@kernel.org>,
	Yu Zhao <yuzhao@google.com>, Yang Shi <shy828301@gmail.com>,
	Michal Hocko <mhocko@suse.com>,
	Kefeng Wang <wangkefeng.wang@huawei.com>,
	Barry Song <21cnbao@gmail.com>, Chris Li <chrisl@kernel.org>,
	Lance Yang <ioworker0@gmail.com>
Cc: Ryan Roberts <ryan.roberts@arm.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: [PATCH] FIXUP: mm: swap: free_swap_and_cache_nr() as batched free_swap_and_cache()
Date: Tue,  9 Apr 2024 12:18:40 +0100	[thread overview]
Message-ID: <20240409111840.3173122-1-ryan.roberts@arm.com> (raw)
In-Reply-To: <20240408183946.2991168-3-ryan.roberts@arm.com>

Hi Andrew,

Could you please squash this into commit "mm: swap:
free_swap_and_cache_nr() as batched free_swap_and_cache()", which is
already in mm-unstable?

It fixes a build warning on parisc [1] due to their implementation of
__swp_entry_to_pte() not correctly putting the macro args in
parenthisis. But it turns out that a bunch of other arches are also
faulty in this regard.

I'm also adding an extra statement to the documentation for
pte_next_swp_offset() as suggested by David.

[1] https://lore.kernel.org/all/202404091749.ScNPJ8j4-lkp@intel.com/

Thanks,
Ryan

Signed-off-by: Ryan Roberts <ryan.roberts@arm.com>
---
 mm/internal.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/mm/internal.h b/mm/internal.h
index 9d3250b4a08a..22152e0c8494 100644
--- a/mm/internal.h
+++ b/mm/internal.h
@@ -202,7 +202,8 @@ static inline int folio_pte_batch(struct folio *folio, unsigned long addr,

 /**
  * pte_next_swp_offset - Increment the swap entry offset field of a swap pte.
- * @pte: The initial pte state; is_swap_pte(pte) must be true.
+ * @pte: The initial pte state; is_swap_pte(pte) must be true and
+ *	 non_swap_entry() must be false.
  *
  * Increments the swap offset, while maintaining all other fields, including
  * swap type, and any swp pte bits. The resulting pte is returned.
@@ -211,7 +212,7 @@ static inline pte_t pte_next_swp_offset(pte_t pte)
 {
 	swp_entry_t entry = pte_to_swp_entry(pte);
 	pte_t new = __swp_entry_to_pte(__swp_entry(swp_type(entry),
-						   swp_offset(entry) + 1));
+						   (swp_offset(entry) + 1)));

 	if (pte_swp_soft_dirty(pte))
 		new = pte_swp_mksoft_dirty(new);
--
2.25.1



  parent reply	other threads:[~2024-04-09 11:18 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-08 18:39 [PATCH v7 0/7] Swap-out mTHP without splitting Ryan Roberts
2024-04-08 18:39 ` [PATCH v7 1/7] mm: swap: Remove CLUSTER_FLAG_HUGE from swap_cluster_info:flags Ryan Roberts
2024-04-08 18:39 ` [PATCH v7 2/7] mm: swap: free_swap_and_cache_nr() as batched free_swap_and_cache() Ryan Roberts
2024-04-09  7:34   ` David Hildenbrand
2024-04-09  8:51   ` Barry Song
2024-04-09  9:22     ` Barry Song
2024-04-09  9:24       ` David Hildenbrand
2024-04-09  9:41         ` Barry Song
2024-04-09  9:55           ` Ryan Roberts
2024-04-09 10:29             ` Barry Song
2024-04-09 10:42             ` David Hildenbrand
2024-04-09 11:18   ` Ryan Roberts [this message]
2024-04-08 18:39 ` [PATCH v7 3/7] mm: swap: Simplify struct percpu_cluster Ryan Roberts
2024-04-08 18:39 ` [PATCH v7 4/7] mm: swap: Update get_swap_pages() to take folio order Ryan Roberts
2024-04-09  7:36   ` David Hildenbrand
2024-04-08 18:39 ` [PATCH v7 5/7] mm: swap: Allow storage of all mTHP orders Ryan Roberts
2024-05-13  7:30   ` Barry Song
2024-05-13  8:43     ` Ryan Roberts
2024-05-13  9:24       ` Barry Song
2024-04-08 18:39 ` [PATCH v7 6/7] mm: vmscan: Avoid split during shrink_folio_list() Ryan Roberts
2024-04-08 18:39 ` [PATCH v7 7/7] mm: madvise: Avoid split during MADV_PAGEOUT and MADV_COLD Ryan Roberts
2024-06-03 21:18 ` [PATCH v7 0/7] Swap-out mTHP without splitting Yosry Ahmed
2024-06-03 22:01   ` Zi Yan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240409111840.3173122-1-ryan.roberts@arm.com \
    --to=ryan.roberts@arm.com \
    --cc=21cnbao@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=chrisl@kernel.org \
    --cc=david@redhat.com \
    --cc=ioworker0@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    --cc=shy828301@gmail.com \
    --cc=wangkefeng.wang@huawei.com \
    --cc=willy@infradead.org \
    --cc=xiang@kernel.org \
    --cc=ying.huang@intel.com \
    --cc=yuzhao@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox