From patchwork Tue Aug 23 17:03:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vlastimil Babka X-Patchwork-Id: 12952326 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 70FE0C32772 for ; Tue, 23 Aug 2022 17:04:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 47F9594000A; Tue, 23 Aug 2022 13:04:11 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4070594000C; Tue, 23 Aug 2022 13:04:11 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2CFE094000A; Tue, 23 Aug 2022 13:04:11 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 0D6FE94000C for ; Tue, 23 Aug 2022 13:04:11 -0400 (EDT) Received: from smtpin31.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 99005ABDC0 for ; Tue, 23 Aug 2022 17:04:10 +0000 (UTC) X-FDA: 79831480260.31.FE63A5F Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf06.hostedemail.com (Postfix) with ESMTP id 1A50318003C for ; Tue, 23 Aug 2022 17:04:08 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 9212A1F974; Tue, 23 Aug 2022 17:04:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1661274247; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=wb70shFpi2U39YwOZTkgemTiggcVrr1gChZv07+S71s=; b=anP6DHFyco5OySGSmXWogIlw5qnSB0Yug+8QNv1R5nov8ur00LN6Fnugkl2Izkw6a/feMg E65TSbYJF7AfZBo9mIq4pkomoDnhiOsr+EQrOF1nfilBmXqyX6vS1a6S2u/OOArE18+KUg EhLYOVpMnSmPPuOcq9y1+ph8zLkmsXM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1661274247; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=wb70shFpi2U39YwOZTkgemTiggcVrr1gChZv07+S71s=; b=rMDjxIhZ8kynxOE1F4yxnCcGA1uEGHEQj6fBfLsP+FHR0FSP8fnhugw985bsg4AtKn5AUc Upw+uVYjhB23bdBA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 65C4E13AB7; Tue, 23 Aug 2022 17:04:07 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id F3vhF4cIBWPTQgAAMHmgww (envelope-from ); Tue, 23 Aug 2022 17:04:07 +0000 From: Vlastimil Babka To: Rongwei Wang , Christoph Lameter , Joonsoo Kim , David Rientjes , Pekka Enberg Cc: Hyeonggon Yoo <42.hyeyoo@gmail.com>, Roman Gushchin , linux-mm@kvack.org, Sebastian Andrzej Siewior , Thomas Gleixner , Mike Galbraith , Vlastimil Babka Subject: [PATCH v2 0/5] mm/slub: fix validation races and cleanup locking Date: Tue, 23 Aug 2022 19:03:55 +0200 Message-Id: <20220823170400.26546-1-vbabka@suse.cz> X-Mailer: git-send-email 2.37.2 MIME-Version: 1.0 ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=anP6DHFy; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=rMDjxIhZ; spf=pass (imf06.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.29 as permitted sender) smtp.mailfrom=vbabka@suse.cz; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1661274249; a=rsa-sha256; cv=none; b=bu2c8O9jfd5xc5aULJ2QPdYdlcBkXfautbD3u5RYSMPif8xczaDMbwL4u8nfYSi2g0TGFF u1Kh5w0j7tp1rtzRy8BWb8VFa0QCeWwuyeWY1RCJa9QToX+2KpCaHivBNiG/rfN7gnsHTf RCF1VF2hV53eckfraLF1v7QYd2AzOUk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1661274249; 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:references:dkim-signature; bh=wb70shFpi2U39YwOZTkgemTiggcVrr1gChZv07+S71s=; b=T5HA6Z5ktPnAxtnzeHiTHie7vGGn3ZYNmDHyO80FS0COXTEtfHVsuVjwo5f28X2X4MwLJF HKuj9OsEboLAdiaO9jqABpejM0p0z6/C5tEMWKZpjlfgiOiZrxNHXenAayJ7aryF9h0Bax V7BzFBTQWFwtNOJTeRfeXaFwueDOfgk= Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=anP6DHFy; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=rMDjxIhZ; spf=pass (imf06.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.29 as permitted sender) smtp.mailfrom=vbabka@suse.cz; dmarc=none X-Rspam-User: X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: 1A50318003C X-Stat-Signature: qkj36zye8moi9eodp8dwkarr39auduxk X-HE-Tag: 1661274248-811220 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: This series builds on the validation races fix posted previously [1] that became patch 2 here and contains all the details in its description. Thanks to Hyeonggon Yoo's observation, patch 3 removes more slab_lock() usage that became unnecessary after patch 2. This made it possible to further simplify locking code in patches 4 and 5. Since those are related to PREEMPT_RT, I'm CCing relevant people on this series. Changes since v1 [2]: - add acks/reviews from Hyeonggon and David - minor fixes to patch 2 as reported by Hyeonggon - patch 5 reworked to rely on disabled preemption by bit_spin_lock() which should be sufficient without disabled interrupts on RT git version: https://git.kernel.org/pub/scm/linux/kernel/git/vbabka/linux.git/log/?h=slub-validate-fix-v2r2 I plan to add this series to slab.git for-next in few days. [1] https://lore.kernel.org/all/20220809140043.9903-1-vbabka@suse.cz/ [2] https://lore.kernel.org/all/20220812091426.18418-1-vbabka@suse.cz/ Vlastimil Babka (5): mm/slub: move free_debug_processing() further mm/slub: restrict sysfs validation to debug caches and make it safe mm/slub: remove slab_lock() usage for debug operations mm/slub: convert object_map_lock to non-raw spinlock mm/slub: simplify __cmpxchg_double_slab() and slab_[un]lock() mm/slub.c | 417 ++++++++++++++++++++++++++++++++---------------------- 1 file changed, 251 insertions(+), 166 deletions(-)