All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: mm-commits@vger.kernel.org, hca@linux.ibm.com, david@redhat.com,
	borntraeger@linux.ibm.com, anshuman.khandual@arm.com,
	akpm@linux-foundation.org
Subject: + s390-mm-use-pmd_pgtable_page-helper-in-__gmap_segment_gaddr.patch added to mm-unstable branch
Date: Fri, 25 Nov 2022 16:56:40 -0800	[thread overview]
Message-ID: <20221126005642.67325C433D6@smtp.kernel.org> (raw)


The patch titled
     Subject: s390/mm: use pmd_pgtable_page() helper in __gmap_segment_gaddr()
has been added to the -mm mm-unstable branch.  Its filename is
     s390-mm-use-pmd_pgtable_page-helper-in-__gmap_segment_gaddr.patch

This patch will shortly appear at
     https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/s390-mm-use-pmd_pgtable_page-helper-in-__gmap_segment_gaddr.patch

This patch will later appear in the mm-unstable branch at
    git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next via the mm-everything
branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there every 2-3 working days

------------------------------------------------------
From: Anshuman Khandual <anshuman.khandual@arm.com>
Subject: s390/mm: use pmd_pgtable_page() helper in __gmap_segment_gaddr()
Date: Fri, 25 Nov 2022 09:15:02 +0530

In __gmap_segment_gaddr() pmd level page table page is being extracted
from the pmd pointer, similar to pmd_pgtable_page() implementation.  This
reduces some redundancy by directly using pmd_pgtable_page() instead,
though first making it available.

Link: https://lkml.kernel.org/r/20221125034502.1559986-1-anshuman.khandual@arm.com
Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
Cc: Christian Borntraeger <borntraeger@linux.ibm.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/s390/mm/gmap.c |    5 ++---
 include/linux/mm.h  |    2 +-
 2 files changed, 3 insertions(+), 4 deletions(-)

--- a/arch/s390/mm/gmap.c~s390-mm-use-pmd_pgtable_page-helper-in-__gmap_segment_gaddr
+++ a/arch/s390/mm/gmap.c
@@ -336,12 +336,11 @@ static int gmap_alloc_table(struct gmap
 static unsigned long __gmap_segment_gaddr(unsigned long *entry)
 {
 	struct page *page;
-	unsigned long offset, mask;
+	unsigned long offset;
 
 	offset = (unsigned long) entry / sizeof(unsigned long);
 	offset = (offset & (PTRS_PER_PMD - 1)) * PMD_SIZE;
-	mask = ~(PTRS_PER_PMD * sizeof(pmd_t) - 1);
-	page = virt_to_page((void *)((unsigned long) entry & mask));
+	page = pmd_pgtable_page((pmd_t *) entry);
 	return page->index + offset;
 }
 
--- a/include/linux/mm.h~s390-mm-use-pmd_pgtable_page-helper-in-__gmap_segment_gaddr
+++ a/include/linux/mm.h
@@ -2480,7 +2480,7 @@ static inline void pgtable_pte_page_dtor
 
 #if USE_SPLIT_PMD_PTLOCKS
 
-static struct page *pmd_pgtable_page(pmd_t *pmd)
+static inline struct page *pmd_pgtable_page(pmd_t *pmd)
 {
 	unsigned long mask = ~(PTRS_PER_PMD * sizeof(pmd_t) - 1);
 	return virt_to_page((void *)((unsigned long) pmd & mask));
_

Patches currently in -mm which might be from anshuman.khandual@arm.com are

documentation-mm-update-pmd_present-in-arch_pgtable_helpersrst.patch
mm-thp-rename-pmd_to_page-as-pmd_pgtable_page.patch
s390-mm-use-pmd_pgtable_page-helper-in-__gmap_segment_gaddr.patch


                 reply	other threads:[~2022-11-26  0:56 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20221126005642.67325C433D6@smtp.kernel.org \
    --to=akpm@linux-foundation.org \
    --cc=anshuman.khandual@arm.com \
    --cc=borntraeger@linux.ibm.com \
    --cc=david@redhat.com \
    --cc=hca@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mm-commits@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.