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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id A3FB7ECAAD4 for ; Sat, 27 Aug 2022 01:35:58 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 861D5940008; Fri, 26 Aug 2022 21:35:57 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 80FCA940007; Fri, 26 Aug 2022 21:35:57 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6FF72940008; Fri, 26 Aug 2022 21:35:57 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 61EA5940007 for ; Fri, 26 Aug 2022 21:35:57 -0400 (EDT) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 32098160ED8 for ; Sat, 27 Aug 2022 01:35:57 +0000 (UTC) X-FDA: 79843656354.18.75D43FE Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf13.hostedemail.com (Postfix) with ESMTP id D34F020022 for ; Sat, 27 Aug 2022 01:35:56 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 6F931B831BD; Sat, 27 Aug 2022 01:35:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E6984C433D6; Sat, 27 Aug 2022 01:35:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1661564154; bh=FZdgvl+z5rvlO3Bk3GQBKq4odiPFkU2MmC2I/PED5a0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=02pOj+XPjfuCualHR+jl7BkRv3tY44bOGtpdm8NGc15OcRGIA8Pv8R1kVfJZ6GH6I P07Ui0asihnmZSjSwW1sIoQATNERkZWkRDFupultnyUi03CbKFMRZ5mgvXjDCoLVet +7XNB3B0+FFJXl9X48wzFlpVj6PQw/kAAAM7E0Jw= Date: Fri, 26 Aug 2022 18:35:53 -0700 From: Andrew Morton To: Shakeel Butt Cc: Michal Hocko , Feng Tang , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] mm: deduplicate cacheline padding code Message-Id: <20220826183553.4b923552ccddb07f0a78ac8b@linux-foundation.org> In-Reply-To: <20220826230642.566725-1-shakeelb@google.com> References: <20220826230642.566725-1-shakeelb@google.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1661564157; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=kBcvPZgyrayO3PI98WjaGfa6/lxtb6I7VYsFJkg/49s=; b=bpGBgql1+JOhphm8hxiKqPyzxSMyqTiBPBqiKgkcjR6C0hI5XskBDlCd2h2ImKRO3AyVk7 H98ON9FZoouwZnFFVpw4+UJg0tt6bDuXiwgZVHjbUHMxM3o54cebeKOj8AKQp9q9SHMSxt L16JMOa2X8n+97Z3uM1wJTHThY3Fd7Y= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=02pOj+XP; spf=pass (imf13.hostedemail.com: domain of akpm@linux-foundation.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1661564157; a=rsa-sha256; cv=none; b=L9n/YQS9k3mjodCEIT4LeHdc8/0MYUoqvoUVQ8fO0+nhu0Y5vqJrpqrGhZCBbVPYZAgToT vhQ18LWdiIHfg9EfWHFzGkY2Rm6aKH9g7l7Oh8zCT9w8d6CyKVdx+4cpScSK6G7fxQhNBz tNA1wl+fugYTH0T6lqt3/NX9tklY+Tw= X-Rspam-User: Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=02pOj+XP; spf=pass (imf13.hostedemail.com: domain of akpm@linux-foundation.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none X-Rspamd-Server: rspam05 X-Stat-Signature: kx3q78yr3trxsobjrh4b5c45tt9pj44z X-Rspamd-Queue-Id: D34F020022 X-HE-Tag: 1661564156-475946 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: On Fri, 26 Aug 2022 23:06:42 +0000 Shakeel Butt wrote: > There are three users (mmzone.h, memcontrol.h, page_counter.h) using > similar code for forcing cacheline padding between fields of different > structures. Dedup that code. > > ... > > include/linux/cache.h | 13 +++++++++++++ > include/linux/memcontrol.h | 13 ++----------- > include/linux/mmzone.h | 24 +++++------------------- > include/linux/page_counter.h | 13 ++----------- I'm looking for an obvious and reliable way in which those three headers include cache.h. Seems that mm_types.h's inclusion of cache.h should be sufficient. Direct inclusion of cache.h would of course be safest. I guess if it breaks, we'll hear about it ;)