From patchwork Tue Feb 20 16:58:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vlastimil Babka X-Patchwork-Id: 13564278 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 AA844C48BC3 for ; Tue, 20 Feb 2024 16:58:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1ED366B007E; Tue, 20 Feb 2024 11:58:50 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 043A16B0082; Tue, 20 Feb 2024 11:58:49 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CE1BC6B0083; Tue, 20 Feb 2024 11:58:49 -0500 (EST) 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 B81306B007E for ; Tue, 20 Feb 2024 11:58:49 -0500 (EST) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 599E64075E for ; Tue, 20 Feb 2024 16:58:49 +0000 (UTC) X-FDA: 81812791578.01.BF8F2D5 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) by imf12.hostedemail.com (Postfix) with ESMTP id 0439340013 for ; Tue, 20 Feb 2024 16:58:46 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=nMby2dQa; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=Dvg7bYDI; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=nMby2dQa; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=Dvg7bYDI; spf=pass (imf12.hostedemail.com: domain of vbabka@suse.cz designates 195.135.223.131 as permitted sender) smtp.mailfrom=vbabka@suse.cz; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1708448327; 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=IbsSj4kPNKqeufwtGIRDxU3H/ANejP0NGaedjXyeBmw=; b=PYyf0S9u+ieBUwkG3InfGpH6ZPqmVtperKUPh4ME2jNcqfeUSEIKC3iwL2+EF61S6cjDSI yzyZ3xWgcuOhOz7SlijgztMshk08g0yV1/5VjHp95eLR7hPhD4yeGjo/SErT+YWiQs2hyf 7/UW7R4s/Xjbe5xVo4Uc0H1zcwBfWYU= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1708448327; a=rsa-sha256; cv=none; b=Rs87WbUuSa5GIIYayfGaekSPE5RcNYb3NiTqDL5QmMVWwWE40lk33Upk4eeyeXtMT6l4TC XETYWiDQhyVSB9jGh7EM1z4HuAT0TKelE3vDC1lVdrMZ6uaw9lc/mif6rUCe/RWTYClwYb MhIz9zpw4VQYaUc0v63whldHylb9Tj0= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=nMby2dQa; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=Dvg7bYDI; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=nMby2dQa; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=Dvg7bYDI; spf=pass (imf12.hostedemail.com: domain of vbabka@suse.cz designates 195.135.223.131 as permitted sender) smtp.mailfrom=vbabka@suse.cz; dmarc=none Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 1F2AE1F45F; Tue, 20 Feb 2024 16:58:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1708448325; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IbsSj4kPNKqeufwtGIRDxU3H/ANejP0NGaedjXyeBmw=; b=nMby2dQaZBQLJ+hSqHNyWRpkovG6YoED+MQrK/wcTKjs9DdXocgp2HkVkh4jL47opqZ59s alu0O3v/Hb0GotorzSTNYYIeTze3It2JSzrg3gItlPQW2SSRUgYaiH1LVLjKRv3tt2ADHB CreuBVUFqlNBYJRdGs83aQqMhdAdz/Q= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1708448325; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IbsSj4kPNKqeufwtGIRDxU3H/ANejP0NGaedjXyeBmw=; b=Dvg7bYDI7jBbBbXPUcFK9RGsvmeh1YwOoTjCgEljDYbW10kokyzrfXfZn9ztXWz5ygA1b4 rBVq+eb2yvGN+pBQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1708448325; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IbsSj4kPNKqeufwtGIRDxU3H/ANejP0NGaedjXyeBmw=; b=nMby2dQaZBQLJ+hSqHNyWRpkovG6YoED+MQrK/wcTKjs9DdXocgp2HkVkh4jL47opqZ59s alu0O3v/Hb0GotorzSTNYYIeTze3It2JSzrg3gItlPQW2SSRUgYaiH1LVLjKRv3tt2ADHB CreuBVUFqlNBYJRdGs83aQqMhdAdz/Q= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1708448325; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IbsSj4kPNKqeufwtGIRDxU3H/ANejP0NGaedjXyeBmw=; b=Dvg7bYDI7jBbBbXPUcFK9RGsvmeh1YwOoTjCgEljDYbW10kokyzrfXfZn9ztXWz5ygA1b4 rBVq+eb2yvGN+pBQ== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id EC4FD139D0; Tue, 20 Feb 2024 16:58:44 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id w9cGOUTa1GVKXQAAD6G6ig (envelope-from ); Tue, 20 Feb 2024 16:58:44 +0000 From: Vlastimil Babka Subject: [PATCH 0/3] cleanup of SLAB_ flags Date: Tue, 20 Feb 2024 17:58:24 +0100 Message-Id: <20240220-slab-cleanup-flags-v1-0-e657e373944a@suse.cz> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIADDa1GUC/x3MMQqAMAxA0atIZgO2VFGvIg41Rg2UKg2KIN7d4 viG/x9QTsIKffFA4ktU9phhygJo83FllDkbbGVdZU2HGvyEFNjH88Al+FWR2sY5UzNRy5DDI/E i9z8dxvf9AAO1YOtkAAAA To: Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , Roman Gushchin , Hyeonggon Yoo <42.hyeyoo@gmail.com>, Andrey Ryabinin , Alexander Potapenko , Andrey Konovalov , Dmitry Vyukov , Vincenzo Frascino Cc: Zheng Yejian , Xiongwei Song , Chengming Zhou , linux-mm@kvack.org, linux-kernel@vger.kernel.org, kasan-dev@googlegroups.com, Vlastimil Babka , Steven Rostedt X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1607; i=vbabka@suse.cz; h=from:subject:message-id; bh=IL6IiPFaj8L1SHxsifDq30uFwnNpt+3POqEQFoB3w0c=; b=owEBbQGS/pANAwAIAbvgsHXSRYiaAcsmYgBl1No4DszrrX8bOb0HuwiWoDUq2/UBLf1izr1zC ofjfOXIfueJATMEAAEIAB0WIQR7u8hBFZkjSJZITfG74LB10kWImgUCZdTaOAAKCRC74LB10kWI mtb4B/9PLg3CcTI1ueE6xDEvkINOsywJ7L7b+M9ykvZu7hP6O09Z/ODodo42j2o18006IrzeLM9 ag2Hea+OS2X0SZncBYIUydENSmTMdmaI3hrW9oVadH0sKZb/Qme3icKO4fA/HIomAgPOOsKtFmE CgkjqAg4gH4fDyXCMsE0h7MkFmzK/MWB9X3uunAR+2BQ7LQxvy7Tqx01bDiVwkYTNVyms4hkHqv x0Ih7n/T+W3OIM3GL9rgJ0opFSSsFyfVDrrzWPwfKjOgpAlDhiRcroCYFTW/agKdeoDMNY0CE6f Lq3obltIVTB/uCWeakaSxiv9BEpNMyUQlvAKxTZtsw483eXT X-Developer-Key: i=vbabka@suse.cz; a=openpgp; fpr=A940D434992C2E8E99103D50224FA7E7CC82A664 X-Rspamd-Queue-Id: 0439340013 X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: q5fx99n79177tdcr4rk4zxftzm1ayxw3 X-HE-Tag: 1708448326-653315 X-HE-Meta: U2FsdGVkX186X2y7RzcxX1GBeb28rKcRI2JbGrHv4/LttKeBFJ0pofdXLbT+GehBbmPmyUnKn+ISmyMggMVD4Bxipw9ZpJM7OaZIKhIdfKTWqPs1R/Z+mKUZb2o9cndl5hnMaefnCIsAl5sCqKeUsbvsFGR7tQaor5QJfsHCnxdg53Ep/kJtgrZpMw37AdX3kV63Nc3XjQ4cx+hm7UKPC/IrcX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ECT4CUat8/H3ZHB2N8h+TavwJ2RXhBu+AzXyRqLvCaheZ/SmB 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: List-Subscribe: List-Unsubscribe: This started by the report that SLAB_MEM_SPREAD flag is dead (Patch 1). Then in the alloc profiling series we realized it's too easy to reuse an existing SLAB_ flag's value when defining a new one, by mistake. Thus let the compiler do that for us via a new helper enum (Patch 2). When checking if more flags are dead or could be removed, didn't spot any, but found out the SLAB_KASAN handling of preventing cache merging can be simplified since we now have an explicit SLAB_NO_MERGE (Patch 3). The SLAB_MEM_SPREAD flag is now marked as unused and for removal, and has a value of 0 so it's a no-op. Patches to remove its usage can/will be submitted to respective subsystems independently of this series - the flag is already dead as of v6.8-rc1 with SLAB removed. The removal of dead cpuset_do_slab_mem_spread() code can also be submitted independently. Signed-off-by: Vlastimil Babka --- Vlastimil Babka (3): mm, slab: deprecate SLAB_MEM_SPREAD flag mm, slab: use an enum to define SLAB_ cache creation flags mm, slab, kasan: replace kasan_never_merge() with SLAB_NO_MERGE include/linux/kasan.h | 6 ---- include/linux/slab.h | 86 +++++++++++++++++++++++++++++++++++++-------------- mm/kasan/generic.c | 16 +++------- mm/slab.h | 1 - mm/slab_common.c | 2 +- mm/slub.c | 6 ++-- 6 files changed, 71 insertions(+), 46 deletions(-) --- base-commit: 6613476e225e090cc9aad49be7fa504e290dd33d change-id: 20240219-slab-cleanup-flags-c864415ecc8e Best regards,