From patchwork Thu Jun 22 08:24:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qi Zheng X-Patchwork-Id: 13288414 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 D9C2DEB64D8 for ; Thu, 22 Jun 2023 08:26:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6DBFB8D0003; Thu, 22 Jun 2023 04:26:15 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 68C5F8D0001; Thu, 22 Jun 2023 04:26:15 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 52D908D0003; Thu, 22 Jun 2023 04:26:15 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 441568D0001 for ; Thu, 22 Jun 2023 04:26:15 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id A69FB1207DA for ; Thu, 22 Jun 2023 08:26:14 +0000 (UTC) X-FDA: 80929701468.11.CE09D5F Received: from out-1.mta0.migadu.com (out-1.mta0.migadu.com [91.218.175.1]) by imf17.hostedemail.com (Postfix) with ESMTP id DB99F4001B for ; Thu, 22 Jun 2023 08:26:12 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=XwhMjboY; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf17.hostedemail.com: domain of qi.zheng@linux.dev designates 91.218.175.1 as permitted sender) smtp.mailfrom=qi.zheng@linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1687422373; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=w53NcBmn/IPVgjrXh3hKsvtsk7tDad26SsdH585QToY=; b=Iia2gkPy59pSop9rBQWgKjCE/FyQKZJArHMuJfFXKIjXZfnEQIx4OKxVdeSaFJXVaTH00H f2dFyfyuNzDvF3IdS4HUy2j3GygBAHqNgVEViyb9KOy8PwKpVtkIPEv4norAehuffufeaW x75gy7fz29eWHeQWBNI6NSUTE5zQxpY= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=XwhMjboY; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf17.hostedemail.com: domain of qi.zheng@linux.dev designates 91.218.175.1 as permitted sender) smtp.mailfrom=qi.zheng@linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1687422373; a=rsa-sha256; cv=none; b=c/ebZ0/B8i2pR/2t6bdmA+Os55Ix0d7mx+uPonXtc4+h/aMItDHmAJzCIfUNisBll0wIJT 4Ajoa7yY0H4NieeFrZCAfBJUHaeGXfoA/RWjbmcEAmbuz7bIxdYXRhrsWEUgGYpCLzYFcR MH21yd9hMoNoFInKiZLT9bZcsg3uP1Y= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1687422370; 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=w53NcBmn/IPVgjrXh3hKsvtsk7tDad26SsdH585QToY=; b=XwhMjboYkO1IjigA7jJUMcuvrlsYL6AEdKhP6EAdQek7nGl7SCwZP+s1KaXaDd0EbpkijC WzHmsAAL7fH0Q68pqE9kbEs/wm6WDN8VuTFUTe+F4YIjoGCH/bDYiJlTs6zAXz5aY/DcIU qOKI3csGnCUAw3UqbPNbuNVS2tXOJrg= From: Qi Zheng To: akpm@linux-foundation.org, david@fromorbit.com, tkhai@ya.ru, vbabka@suse.cz, roman.gushchin@linux.dev, djwong@kernel.org, brauner@kernel.org, paulmck@kernel.org, tytso@mit.edu Cc: airlied@gmail.com, daniel@ffwll.ch, robdclark@gmail.com, quic_abhinavk@quicinc.com, dmitry.baryshkov@linaro.org, sean@poorly.run, marijn.suijten@somainline.org, robh@kernel.org, tomeu.vizoso@collabora.com, steven.price@arm.com, alyssa.rosenzweig@collabora.com, agk@redhat.com, snitzer@kernel.org, song@kernel.org, colyli@suse.de, kent.overstreet@gmail.com, namit@vmware.com, gregkh@linuxfoundation.org, mst@redhat.com, david@redhat.com, jasowang@redhat.com, xuanzhuo@linux.alibaba.com, viro@zeniv.linux.org.uk, adilger.kernel@dilger.ca, jack@suse.com, chuck.lever@oracle.com, neilb@suse.de, kolga@netapp.com, minchan@kernel.org, senozhatsky@chromium.org, clm@fb.com, josef@toxicpanda.com, dsterba@suse.com, christian.koenig@amd.com, ray.huang@amd.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, dm-devel@redhat.com, linux-raid@vger.kernel.org, linux-bcache@vger.kernel.org, virtualization@lists.linux-foundation.org, linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-nfs@vger.kernel.org, linux-xfs@vger.kernel.org, linux-btrfs@vger.kernel.org, Qi Zheng Subject: [PATCH 01/29] mm: shrinker: add shrinker::private_data field Date: Thu, 22 Jun 2023 08:24:26 +0000 Message-Id: <20230622082454.4090236-2-qi.zheng@linux.dev> In-Reply-To: <20230622082454.4090236-1-qi.zheng@linux.dev> References: <20230622082454.4090236-1-qi.zheng@linux.dev> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: DB99F4001B X-Stat-Signature: tpua9u3f48hiepgcib784o3qqy1nx3m7 X-Rspam-User: X-HE-Tag: 1687422372-618907 X-HE-Meta: U2FsdGVkX18AXdX8JIp+3PK/VTz/5qFDQF5jFBUXmQS+8g4tj11NKFvxlJ+rI4u31BVtAeTpNQ5A1Bw83CjP/U2pSC7j6JlOtaStcIp7a/5vViVXg00F7BugFVHn5LLzk3g4T9vVgXQj2DLfX3ok+cHbGEBEvM1gXQ5iUkK1CkPIjmD+5WsaD5G7v7BTr0RoTPVDncGYyVUjuGlqIc6NGNZLm3+HE3VoIZG8BxA4UijgoXctfWqmge3pcMO2KhvHY3YU9smIAJT+JTY0Fl/CHdNRshQjQ2wbBS66LWykziHTF5udPwMDKtcA1CFPKAG1JbG8sYJaj+6gVmw+JhVq2B+SoyZ+lAMBnOwSW2FhqLfeuOnfAcsMJQwC+T0/CuK0H4GGUZxiwtdabrIVbYqIuquOwwSr0ZXq9U2OEGN5TWJeqirNbzH2s3inhgZQ9vpPZ/ONboxNsyr2xauTbJYw+K44Lv93ckEzm/kRrchWwPYuujv3wdUEQ72e8NG8heZAfMrEahyNGIvrv7Bm7ilvmRztURYWqZQ9eep10Tb5w/C77y48rl97MO0DMnR2reExbIq25OkBL5zuY+3RKUIIHG7QkGHzzuHvhTaDMguJdKVDpskGR52oNe3sF491yPFir/IohkeTejifsuYPDFHTLZfvFbybqhZsgozL8mx93AM7LRIl18dWjulu6x3V6qxQTlKx0veHFUi/tdYmGIn78zXIrXRyH5boGe8uELUckRZsfe7ZH901VS6OfQCL73aTJfwuZaBtjM0AQDx5aAkOafHzdDBiPEDNvf04DQGicf7cJ/8G9tWqaBw69nQhdfsMYP+mVuo4lz0GxThQycnI5VC89fkcYPQKmMVWlIMw0PHuEEF83Rf3BJA8irSY7jnGGmz/pOsUOYp4FObCgS7/y7w/Dl8Lsbztwjq1tBSpoS2oXcnyOawKsprhZ1cPFCdLup/kp8tP7L9wjHw4jIC xeDWebKJ MSxz67KU0wqB9YUI48r8oXuSDY9cuaPho0F68CsPJmNgjD6o7IzUV3OJbLxMS7TqmPlW9mwAcB3LiHN5+SGd1/9BcnzfzOSqHz0rxfCmI6M7MsnaU26L7S2Nrrt/3YHmgXoxD3tkqMsc8EvrFBmZ0t6pxx+teJ1wKMLeEd4oc0wcthXL+wmVin4Sb1z7jPNsX1UyfS/kuerJYo0zttedVY2o9s9M60XaPfljJWTI3kkYkdsnWMRL9rsLzyBpkkRhmnTEy 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: From: Qi Zheng To prepare for the dynamic allocation of shrinker instances embedded in other structures, add a private_data field to struct shrinker, so that we can use shrinker::private_data to record and get the original embedded structure. Signed-off-by: Qi Zheng --- include/linux/shrinker.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/linux/shrinker.h b/include/linux/shrinker.h index 224293b2dd06..43e6fcabbf51 100644 --- a/include/linux/shrinker.h +++ b/include/linux/shrinker.h @@ -70,6 +70,8 @@ struct shrinker { int seeks; /* seeks to recreate an obj */ unsigned flags; + void *private_data; + /* These are for internal use */ struct list_head list; #ifdef CONFIG_MEMCG