linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Oleksandr Natalenko <oleksandr@natalenko.name>
To: linux-kernel@vger.kernel.org
Cc: linux-mm@kvack.org, Andrew Morton <akpm@linux-foundation.org>,
	Vlastimil Babka <vbabka@suse.cz>,
	Matthew Wilcox <willy@infradead.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Miaohe Lin <linmiaohe@huawei.com>,
	Michal Hocko <mhocko@kernel.org>,
	Mel Gorman <mgorman@techsingularity.net>,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	David Laight <David.Laight@ACULAB.COM>
Subject: [RFC v2 PATCH 1/3] mm: add PG2KB/KB2PG helper macros
Date: Sun, 19 Sep 2021 15:12:46 +0200	[thread overview]
Message-ID: <20210919131248.489798-2-oleksandr@natalenko.name> (raw)
In-Reply-To: <20210919131248.489798-1-oleksandr@natalenko.name>

Signed-off-by: Oleksandr Natalenko <oleksandr@natalenko.name>
---
 include/linux/mm.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/include/linux/mm.h b/include/linux/mm.h
index 00bb2d938df4..0a7e950ac8aa 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -98,6 +98,9 @@ extern int mmap_rnd_compat_bits __read_mostly;
 #include <asm/page.h>
 #include <asm/processor.h>
 
+#define PG2KB(x)	((x) << (PAGE_SHIFT - 10))
+#define KB2PG(x)	((x) >> (PAGE_SHIFT - 10))
+
 /*
  * Architectures that support memory tagging (assigning tags to memory regions,
  * embedding these tags into addresses that point to these memory regions, and
-- 
2.33.0



  reply	other threads:[~2021-09-19 13:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-19 13:12 [RFC v2 PATCH 0/3] mm: common PAGE_SIZE shift macros Oleksandr Natalenko
2021-09-19 13:12 ` Oleksandr Natalenko [this message]
2021-09-19 13:21   ` [RFC v2 PATCH 1/3] mm: add PG2KB/KB2PG helper macros Greg Kroah-Hartman
2021-09-19 14:21   ` Matthew Wilcox
2021-09-19 13:12 ` [RFC v2 PATCH 2/3] mm: replace custom PG2KB/KB2PG macros with common ones Oleksandr Natalenko
2021-09-19 13:12 ` [RFC v2 PATCH 3/3] mm: replace open-coded PG2KB/KB2PG variants with macros Oleksandr Natalenko

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=20210919131248.489798-2-oleksandr@natalenko.name \
    --to=oleksandr@natalenko.name \
    --cc=David.Laight@ACULAB.COM \
    --cc=akpm@linux-foundation.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linmiaohe@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@techsingularity.net \
    --cc=mhocko@kernel.org \
    --cc=sfr@canb.auug.org.au \
    --cc=vbabka@suse.cz \
    --cc=willy@infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox