From patchwork Thu Jun 22 08:53:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qi Zheng X-Patchwork-Id: 13288580 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 254C9EB64DA for ; Thu, 22 Jun 2023 08:54:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B8E658D0006; Thu, 22 Jun 2023 04:54:14 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B3E0A8D0001; Thu, 22 Jun 2023 04:54:14 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9B7A68D0006; Thu, 22 Jun 2023 04:54:14 -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 8BBB08D0001 for ; Thu, 22 Jun 2023 04:54:14 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 4DF0940B18 for ; Thu, 22 Jun 2023 08:54:14 +0000 (UTC) X-FDA: 80929772028.24.CD2EAAA Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) by imf17.hostedemail.com (Postfix) with ESMTP id 6D9B440003 for ; Thu, 22 Jun 2023 08:54:12 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=bytedance.com header.s=google header.b=AuFJ2ff7; dmarc=pass (policy=quarantine) header.from=bytedance.com; spf=pass (imf17.hostedemail.com: domain of zhengqi.arch@bytedance.com designates 209.85.214.174 as permitted sender) smtp.mailfrom=zhengqi.arch@bytedance.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1687424052; 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=DFMKKDRv9BEw0wZ8UUzCf9pHUtxe8HkFUWg9bN69VRM=; b=ty51A9sfxV/d8M6dPILIMNq8S3GdZQO6jgjvSYDemR0AvNJhe68RVsfEQpTi1Tphv7C+le 2u5aeN7B+OBV1mjpV+WSpKh37zl55t8NZaSS5yAI6ioNREJoAt2tKxUsRxI4QJVic6uapK BtmaInFRbVbOE657rGKsoDFWnNXPVnk= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=bytedance.com header.s=google header.b=AuFJ2ff7; dmarc=pass (policy=quarantine) header.from=bytedance.com; spf=pass (imf17.hostedemail.com: domain of zhengqi.arch@bytedance.com designates 209.85.214.174 as permitted sender) smtp.mailfrom=zhengqi.arch@bytedance.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1687424052; a=rsa-sha256; cv=none; b=IvBLifgTNwiQL7kK0cmtHDw5IkAZ7cCm1cDLub05DYuQGJli6TH5ZiFngbNmcm6p46s7pi KZBNCUqswUHJyI8pK7Y1kOZdkd+I2ncPdSmbB4cfp114dOWl2gGk2+GUgtTXNzyxx752Rs 8fhBxoWksYmii6Tzwphx4vDmeOEwC5A= Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-1b5466bc5f8so9651715ad.1 for ; Thu, 22 Jun 2023 01:54:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1687424051; x=1690016051; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=DFMKKDRv9BEw0wZ8UUzCf9pHUtxe8HkFUWg9bN69VRM=; b=AuFJ2ff77l/LXEOtYzZWEupZaAfbwt3boPeShk25fcGMwTsb6VlfqfAhMOVgIPnKgi eqcOSF5WVHBBVioigqwmY9UAoTi5JEhiUSGdMReu4dDGNOFEVgxVIc2OKO3nltUsVDLn bIiXH0DnqlXam4z90R2tFa6XgNVpJSLaIq6Gbf9RXLnB8BOaf0v/n1c1hG3kRZPk0MVc mjQpq7kQFhiCgtBijMi8fR+x4TAH8zuouOKbSAqWM+GHeJnchPRb4XIBJxswbiSbm3XO sXBcqfmZ/ARe540iNA/E7F7ZKvP/VvSbnbTILDPrN3l0DanjIGoHjsT1U12ioP3F05dG yTtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687424051; x=1690016051; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DFMKKDRv9BEw0wZ8UUzCf9pHUtxe8HkFUWg9bN69VRM=; b=cqGGLIpMo/hjvqXizFC1OUb4JyB8iJAMf2aoBvnUU9n+UPN23mcjRobovlv50H6jux 8QpCv6UWg0UCHoYKGph3m59o6KZ6VL+0PVPQ9wTOZX3HUhHVDU2+/mCutunjywUZY+jO VAlgyE584JSB++A1NhjvqL5prL67S6DJ09tvKuXo904tB6c61U5xbP5CCKYT5VNSK6du dBTpcHPa2AREgzXvrhVk6SYcpGRNBwBhoCdFX+e7UDdOcu7oRIEFOXiM+/uN8At3tEF+ 96TrXjE+bczyKe5iQis5lpxLTbZjFnRsrxj8b6mdbDyKmq/lXOZicoMhY9zEyFGGF5ph 84Ag== X-Gm-Message-State: AC+VfDx3OwPKRCSTlb68OQljcreyzZ07IO2BHn8FwuRPeiIiZ/lRzljU G6XV8eAezv30/945cMslk0PuHQ== X-Google-Smtp-Source: ACHHUZ41Ov0V9PIJeBixnqaY8MSMJrvGTOtmFbuG0vAMaQAXgKytEj5uEpxgQHkUs9eKy8wwGzA30Q== X-Received: by 2002:a17:902:f691:b0:1b3:d4bb:3515 with SMTP id l17-20020a170902f69100b001b3d4bb3515mr21827814plg.0.1687424051106; Thu, 22 Jun 2023 01:54:11 -0700 (PDT) Received: from C02DW0BEMD6R.bytedance.net ([139.177.225.254]) by smtp.gmail.com with ESMTPSA id h2-20020a170902f7c200b001b549fce345sm4806971plw.230.2023.06.22.01.54.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Jun 2023 01:54:10 -0700 (PDT) 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: linux-kernel@vger.kernel.org, linux-mm@kvack.org, intel-gfx@lists.freedesktop.org, dri-devel@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 16:53:07 +0800 Message-Id: <20230622085335.77010-2-zhengqi.arch@bytedance.com> X-Mailer: git-send-email 2.24.3 (Apple Git-128) In-Reply-To: <20230622085335.77010-1-zhengqi.arch@bytedance.com> References: <20230622085335.77010-1-zhengqi.arch@bytedance.com> MIME-Version: 1.0 X-Rspam-User: X-Stat-Signature: wfymdtzdp9hnxu51gw6bxbesuna1y3t1 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 6D9B440003 X-HE-Tag: 1687424052-788289 X-HE-Meta: U2FsdGVkX1/pucY2Aqo47vk7uL+VTJIe0Z+X15iSbdmHmw9SAB9U5H27ac3pmzAH/kFjQiM7m7VRLXxCf8/of0SYxTgETcqOUDiadEgbWjvglSXRFhIOQgMWAxeiuXRMOgTsUdyp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VSIIXkekyBUJs/c7DQWV5jf/IIDtB+Dwl9oCG3GPxeHyBeBMoRTg6kjzO9kFrVBp0bSz3rFGt1ue/F78QanRMsmpFuBW51E8BjB/uxL2dM1r/UD+8g4VDwT1AR+t/xCh4QPigjVII+L+qHqy1kY2vHl6IT5NQIbCj0BJfhnB/s1vgeKZZxSDvq8i1k64vmSbABOGyVV1wacgEDss/4oLiYI5JT6Xo/++s9g/srnvKyDA== 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: 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