From patchwork Sun Sep 19 13:12:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksandr Natalenko X-Patchwork-Id: 12504311 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_ADSP_ALL, DKIM_INVALID,DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5381DC433F5 for ; Sun, 19 Sep 2021 13:12:55 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id DD01461242 for ; Sun, 19 Sep 2021 13:12:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org DD01461242 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=natalenko.name Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 49444940007; Sun, 19 Sep 2021 09:12:54 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 41218900003; Sun, 19 Sep 2021 09:12:54 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2B20A900002; Sun, 19 Sep 2021 09:12:54 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0239.hostedemail.com [216.40.44.239]) by kanga.kvack.org (Postfix) with ESMTP id 18D4E6B006C for ; Sun, 19 Sep 2021 09:12:54 -0400 (EDT) Received: from smtpin40.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id BCC538249980 for ; Sun, 19 Sep 2021 13:12:53 +0000 (UTC) X-FDA: 78604363026.40.542E9DF Received: from vulcan.natalenko.name (vulcan.natalenko.name [104.207.131.136]) by imf16.hostedemail.com (Postfix) with ESMTP id 05A57F0000A5 for ; Sun, 19 Sep 2021 13:12:52 +0000 (UTC) Received: from localhost (unknown [151.237.229.131]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by vulcan.natalenko.name (Postfix) with ESMTPSA id AA625BF2678; Sun, 19 Sep 2021 15:12:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=natalenko.name; s=dkim-20170712; t=1632057171; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/joGQdNC2N2dNh84qcUkN4z807uaMjxshBBAeQbTcZg=; b=cw6S0SRniqaNmiqXzJQXeculZrOiEv6N3ufqssUSvlXSBjgcCFPJdsiz5iA7+q/4w/l/5z HBGP7hCqMFOQQFyqEQCqKg1a4WdWXjTkVlaeVli4WZ647YocRaTECmPIYZDHJ8Gqy+nuXU GU7wBKxFb5fFyHS1PX/XZUSYFeaIo9w= From: Oleksandr Natalenko To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, Andrew Morton , Vlastimil Babka , Matthew Wilcox , Greg Kroah-Hartman , Miaohe Lin , Michal Hocko , Mel Gorman , Stephen Rothwell , David Laight Subject: [RFC v2 PATCH 1/3] mm: add PG2KB/KB2PG helper macros Date: Sun, 19 Sep 2021 15:12:46 +0200 Message-Id: <20210919131248.489798-2-oleksandr@natalenko.name> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210919131248.489798-1-oleksandr@natalenko.name> References: <20210919131248.489798-1-oleksandr@natalenko.name> MIME-Version: 1.0 Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=natalenko.name header.s=dkim-20170712 header.b=cw6S0SRn; spf=pass (imf16.hostedemail.com: domain of oleksandr@natalenko.name designates 104.207.131.136 as permitted sender) smtp.mailfrom=oleksandr@natalenko.name; dmarc=pass (policy=reject) header.from=natalenko.name X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 05A57F0000A5 X-Stat-Signature: 4355mdxfqx695jgkezs8rqqojzbw94cf X-HE-Tag: 1632057172-605830 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: Signed-off-by: Oleksandr Natalenko --- 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 #include +#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