Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1235830pxb; Sun, 19 Sep 2021 10:18:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwtMscE9bmDhTmA593N2UPs7X1eJezyWoEO30ciW1z9eDbvsJSKFugaQMqXQmjpzQHtn7Ku X-Received: by 2002:a50:9d8e:: with SMTP id w14mr1884708ede.74.1632071908915; Sun, 19 Sep 2021 10:18:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632071908; cv=none; d=google.com; s=arc-20160816; b=QZH+WJWk3tg/Yx/G5uoB1BuW2rNT9lIakv7wMczMbKl/TkBLwFWxsuKM+iF7oktCy2 ekwFJVzcjDIAzdWDyy+W438LNg1EWpqEAN3Gpiinn0zr4qIXSApIEQK1I9mFbxzOfUGX y5uzGe2uvZ3Pd65KgpiTsOr0PuwY6OB7FF0PBdcOX3gsiPFn4OKyD3TxboRFothZvcmD Jng3swFz7QifXtcGNVRmNLedS6wVOOdP2yCcjeMPvdxYUTsCJcR00A9W4ND19vxlkpWB OlZMeRWhAz+FF7vi33t5ki0VmIxEt9E3yBqYHkhHB6VTw2J2fS06ZO6N+IfiSTM4fMow 5Qsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=aCl+VghzyEiyjUoK2790KFGP0asW0O8HexpK5Dl0aDY=; b=fCEmNHDPPXXAxTTR9eCqHCyHmFqVc8aCB06bWECFxm2mQCknk0fSSaQhIyBx/n9pOc xhG7E3l+0sXguOt3zLa6oiA4sEE17cOsG5V5ujOkCDFJPHagHm2/Pv0UdRS6rpggCpYq d6itmLJTFoHydQ5CVzRB59GwKvCwMj9PDBQORx71lpcF69XUoqd1mNKxW8LIjF0H4biD KmzIWx/1dtzkrQswls/DXCnrWXKDaJvxQ+JcVBRP94uN/eYsKpXLFAosDZasbuVHo/qV D6zCh3bRtMM5zK9vxv+lygcYJYqX93Ou0dENG3417sF1A6JnfsWGmT2WqNeEQFqRozRT HCPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@natalenko.name header.s=dkim-20170712 header.b="UMgO/lyG"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=natalenko.name Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 14si9965894ejf.337.2021.09.19.10.18.05; Sun, 19 Sep 2021 10:18:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@natalenko.name header.s=dkim-20170712 header.b="UMgO/lyG"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=natalenko.name Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230258AbhISNOT (ORCPT + 99 others); Sun, 19 Sep 2021 09:14:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56228 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229938AbhISNOS (ORCPT ); Sun, 19 Sep 2021 09:14:18 -0400 Received: from vulcan.natalenko.name (vulcan.natalenko.name [IPv6:2001:19f0:6c00:8846:5400:ff:fe0c:dfa0]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B724C061574 for ; Sun, 19 Sep 2021 06:12:53 -0700 (PDT) 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 252B2BF2677; Sun, 19 Sep 2021 15:12:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=natalenko.name; s=dkim-20170712; t=1632057170; 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; bh=aCl+VghzyEiyjUoK2790KFGP0asW0O8HexpK5Dl0aDY=; b=UMgO/lyGpAm5aWHQkE7Cx3jA4PYYN7nOLCUsyxMwBPQVVTAv/Xy0aHhzCJ6PAXfN5wIiZ4 PR3NfiCZW3ydjZTOUJQc8/6qonJz0hl5gNyZtRZFQUdvIj1eLGUreOuDq2a2gpgAujuxmu wHqn8jfXkhTXahOuJQhEBjxTwzYAveY= 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 0/3] mm: common PAGE_SIZE shift macros Date: Sun, 19 Sep 2021 15:12:45 +0200 Message-Id: <20210919131248.489798-1-oleksandr@natalenko.name> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org There are various places where the K(x) macro (or its alternative and/or counterpart) is defined. This submission gets rid of multiple definitions and provides common ones. Based on discussion with Miaohe Lin [1]. The patch is based on top of next-20210910 and is compile-tested using allyesconfig. RFC v1: [2]. Changes since RFC v1: * change name from K(x) to PG2KB(x) * also provide KB2PG(x) * replace open-coded variants * do not use separate header file for macro definitions [1] https://lore.kernel.org/linux-mm/9161665.bUqNH3lxUD@natalenko.name/ [2] https://lore.kernel.org/lkml/20210901092149.994791-1-oleksandr@natalenko.name/ Oleksandr Natalenko (3): mm: add PG2KB/KB2PG helper macros mm: replace custom PG2KB/KB2PG macros with common ones mm: replace open-coded PG2KB/KB2PG variants with macros arch/alpha/kernel/setup.c | 3 +- arch/arc/include/asm/arcregs.h | 4 +- arch/mips/mm/init.c | 2 +- arch/powerpc/platforms/pseries/cmm.c | 17 ++-- arch/s390/appldata/appldata_mem.c | 19 ++-- arch/x86/kernel/cpu/mtrr/cleanup.c | 17 ++-- block/blk-sysfs.c | 9 +- drivers/base/node.c | 69 ++++++++------- drivers/gpu/drm/v3d/v3d_debugfs.c | 3 +- drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c | 5 +- drivers/md/md-bitmap.c | 4 +- drivers/scsi/mpt3sas/mpt3sas_base.c | 5 +- drivers/xen/xen-balloon.c | 11 ++- fs/ceph/addr.c | 2 +- fs/ceph/super.h | 3 +- fs/fs-writeback.c | 2 +- fs/nfs/write.c | 4 +- fs/nfsd/nfscache.c | 3 +- fs/proc/meminfo.c | 4 +- fs/proc/task_mmu.c | 3 +- include/linux/mm.h | 3 + include/trace/events/writeback.h | 19 ++-- kernel/debug/kdb/kdb_main.c | 3 +- kernel/events/core.c | 2 +- kernel/fork.c | 2 +- mm/backing-dev.c | 22 +++-- mm/hugetlb.c | 2 +- mm/memcontrol.c | 18 ++-- mm/mmap.c | 6 +- mm/nommu.c | 4 +- mm/oom_kill.c | 16 ++-- mm/page-writeback.c | 4 +- mm/page_alloc.c | 86 +++++++++---------- mm/shmem.c | 3 +- mm/swap_state.c | 5 +- mm/swapfile.c | 11 ++- mm/util.c | 6 +- 37 files changed, 197 insertions(+), 204 deletions(-) -- 2.33.0