From patchwork Mon Sep 11 09:25:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Qi Zheng X-Patchwork-Id: 13379031 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 70BA8EEB57E for ; Mon, 11 Sep 2023 09:26:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A12136B018A; Mon, 11 Sep 2023 05:25:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9C1966B018B; Mon, 11 Sep 2023 05:25:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8B08C6B018C; Mon, 11 Sep 2023 05:25:59 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 7DA956B018A for ; Mon, 11 Sep 2023 05:25:59 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 4D769A0934 for ; Mon, 11 Sep 2023 09:25:59 +0000 (UTC) X-FDA: 81223784838.26.DD00F79 Received: from mail-pf1-f169.google.com (mail-pf1-f169.google.com [209.85.210.169]) by imf08.hostedemail.com (Postfix) with ESMTP id 8C6A316001D for ; Mon, 11 Sep 2023 09:25:56 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=bytedance.com header.s=google header.b=NZoUF+9L; dmarc=pass (policy=quarantine) header.from=bytedance.com; spf=pass (imf08.hostedemail.com: domain of zhengqi.arch@bytedance.com designates 209.85.210.169 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=1694424357; 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: references:dkim-signature; bh=BVX9WeWGptEOVbuDunuTR7x+0VEpx5JzgLCEo/pvZQ8=; b=ve1aK/d17jDdiav77pU+b14xkaZSqQK+V6J993p+qfsdsNN+iIo2+iEfVObNT2y6ax4PjR XnkW4hZ/UhWNhsm7leR1MDWFlAtSmov1zwVeIt57H9g/CkwBDDgfL+GIcBIDxrwUT5h83E Ma/m1Jf1vFjjIzq+VDjNvkhvEedHvW4= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=bytedance.com header.s=google header.b=NZoUF+9L; dmarc=pass (policy=quarantine) header.from=bytedance.com; spf=pass (imf08.hostedemail.com: domain of zhengqi.arch@bytedance.com designates 209.85.210.169 as permitted sender) smtp.mailfrom=zhengqi.arch@bytedance.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1694424357; a=rsa-sha256; cv=none; b=38QJ97Ao2jXCtg8PuW/O7qMP9aT/37bYuttUJc9FEacRlAuSKuBiC+T0Zdsc80joLITaGS sZkTJrWunPjy6ynEp9Hf3ZHvuBQX/b8u+LhoQHk75d4I/FR3fYeoA1b6h6CDE8hwE44Un5 JmOFcHpOrEcaHn33m0QCgRMY8Z55MpI= Received: by mail-pf1-f169.google.com with SMTP id d2e1a72fcca58-68fc49ccbf2so175176b3a.0 for ; Mon, 11 Sep 2023 02:25:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1694424355; x=1695029155; darn=kvack.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=BVX9WeWGptEOVbuDunuTR7x+0VEpx5JzgLCEo/pvZQ8=; b=NZoUF+9L/pLVkUzzagi4jghymY1/tJsA30PH5kTI6Q0MYtMZX55WA6lIkYzHZ5LUA+ k+KQlokHMsemt7nvUoczEn6ob+CpXsYZm/FnoaqSUYIm0HQJwE0bF/16g1UApPgS8kE4 YArbRrFEv2aEG4W3de4Ykjz7SyuHHN+E1GO74OEJGsKcyTF9WD5N02kit2+ch3qX++4T GoG96BcFWKEKCSFeA+bchGZ7SDnziI16CvFY5e+uxLR1dDwbSu+IF1bWBZ3nL7pPHVzJ ITVkehDVfP8nXscF2VqA1TT/RWzvAwhOq4GGaS5A5u+KJExlZi/dyQfBWFSWAeY98tvH SsYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694424355; x=1695029155; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=BVX9WeWGptEOVbuDunuTR7x+0VEpx5JzgLCEo/pvZQ8=; b=HaTZv+ax1i8HdSBae67EQBgGbwjqLhldHDdUJH92A09gmVgNwld722155dzIQt9E6Y UghARhxmD6+fQR5sIdJ85A4WiFdXIfinugLn3jIISwr1P1Ro0Rsjhn0szHc5FCgOSUWN iys83iOXB2u6h1TdHZRwXx0ncKeA8Mqqe51nt13JDPoqKcgxU2oXUJWY1fNxZo9tLBxq ZxqYg7fhuYZjFxvC/vABwgEkXUpWf0KmzAIWwSbDC3lNwUMhnBs90tii6cNUl6cmCQM7 Kv8AWgu+QpWM8AME6rE0S+mdpUlWN42S2HfhvC31J4ct6vfWhGc40KaJxOdToF2VqmA0 HLSg== X-Gm-Message-State: AOJu0YzHi8aSAoNrsWP58o+tO9/y95wBTFEASKqhxUaock2tqqkD4gIL PMnT6Dw0VsXIwIFKxR51+7i54g== X-Google-Smtp-Source: AGHT+IFA8N2LVaGnVCnfvNYWcDqv3xveqW6PwXfspm7irjG2TpwEtxpwFLm2nXmkPtV/jExbnj34Wg== X-Received: by 2002:a05:6a20:5498:b0:145:3bd9:1377 with SMTP id i24-20020a056a20549800b001453bd91377mr11799129pzk.5.1694424355065; Mon, 11 Sep 2023 02:25:55 -0700 (PDT) Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.146]) by smtp.gmail.com with ESMTPSA id q9-20020a170902788900b001b89466a5f4sm5964623pll.105.2023.09.11.02.25.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Sep 2023 02:25:54 -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, steven.price@arm.com, cel@kernel.org, senozhatsky@chromium.org, yujie.liu@intel.com, gregkh@linuxfoundation.org, muchun.song@linux.dev, joel@joelfernandes.org, christian.koenig@amd.com, daniel@ffwll.ch Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, dri-devel@lists.freedesktop.org, linux-fsdevel@vger.kernel.org, Qi Zheng Subject: [PATCH v4 0/4] cleanups for lockless slab shrink Date: Mon, 11 Sep 2023 17:25:13 +0800 Message-Id: <20230911092517.64141-1-zhengqi.arch@bytedance.com> X-Mailer: git-send-email 2.24.3 (Apple Git-128) MIME-Version: 1.0 X-Rspamd-Queue-Id: 8C6A316001D X-Rspam-User: X-Rspamd-Server: rspam02 X-Stat-Signature: 4nfwz7r19x85fsm7dzcr5ueiu1iqp95g X-HE-Tag: 1694424356-423566 X-HE-Meta: U2FsdGVkX1/EuDtkCIayQMtSA7dbCbUt0kD7fH+TyQyouXxKcJRF1ObClmtDGrjuGB5XgxRvZN4jcwQwotCVDGLzF/Dwy4t3iWDVOodg7o26/+LMFWHjncMpfHewjhcHuXI44YOEZ4GJ7ArkdvjYIg0DWNx60pIuZCeu7igJNPSUorymSCkYXMBBzoYxyEntMUHd1TdSW18VDv36BxPvO3q9zgRGMleXNs3PaWsT7WBqNtPS4u9zdfwEMN4X8q9oBOT+ief1PbK0aW8cW25TamwsDb+5sf0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muDVIA== 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: Hi all, This series is some cleanups for lockless slab shrink, I dropped the [PATCH v2 5/5] which is more related to the main lockless patch. This series is based on the v6.6-rc1. Comments and suggestions are welcome. Thanks, Qi Changlog in v3 -> v4: - rebase onto the v6.6-rc1 Changlog in part 1 v2 -> part 1 v3: - drop [PATCH v2 5/5] - collect Acked-by - rebase onto the next-20230823 Changlog in part 1 v1 -> part 1 v2: - fix compilation warning in [PATCH 1/5] - rename synchronize_shrinkers() to ttm_pool_synchronize_shrinkers() (pointed by Christian König) - collect Reviewed-by Changlog in v4 -> part 1 v1: - split from the previous large patchset - fix comment format in [PATCH v4 01/48] (pointed by Muchun Song) - change to use kzalloc_node() and fix typo in [PATCH v4 44/48] (pointed by Dave Chinner) - collect Reviewed-bys - rebase onto the next-20230815 Qi Zheng (4): mm: move some shrinker-related function declarations to mm/internal.h mm: vmscan: move shrinker-related code into a separate file mm: shrinker: remove redundant shrinker_rwsem in debugfs operations drm/ttm: introduce pool_shrink_rwsem drivers/gpu/drm/ttm/ttm_pool.c | 17 +- include/linux/shrinker.h | 20 - mm/Makefile | 4 +- mm/internal.h | 28 ++ mm/shrinker.c | 694 ++++++++++++++++++++++++++++++++ mm/shrinker_debug.c | 18 +- mm/vmscan.c | 701 --------------------------------- 7 files changed, 743 insertions(+), 739 deletions(-) create mode 100644 mm/shrinker.c