From mboxrd@z Thu Jan 1 00:00:00 1970 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=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 0B923C4332F for ; Sun, 19 Sep 2021 13:12:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E11C261242 for ; Sun, 19 Sep 2021 13:12:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230416AbhISNOU (ORCPT ); Sun, 19 Sep 2021 09:14:20 -0400 Received: from vulcan.natalenko.name ([104.207.131.136]:40806 "EHLO vulcan.natalenko.name" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229576AbhISNOS (ORCPT ); Sun, 19 Sep 2021 09:14:18 -0400 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 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 -- 2.33.0