From patchwork Fri Aug 12 09:14:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vlastimil Babka X-Patchwork-Id: 12942053 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 AD0FDC00140 for ; Fri, 12 Aug 2022 09:14:45 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EA6DE6B0073; Fri, 12 Aug 2022 05:14:44 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E79D66B0078; Fri, 12 Aug 2022 05:14:44 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CA4CE8E0001; Fri, 12 Aug 2022 05:14:44 -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 B4C176B0073 for ; Fri, 12 Aug 2022 05:14:44 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 8795B401AC for ; Fri, 12 Aug 2022 09:14:44 +0000 (UTC) X-FDA: 79790380488.24.2EE2120 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf21.hostedemail.com (Postfix) with ESMTP id EB5141C01C0 for ; Fri, 12 Aug 2022 09:14:43 +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 66ADB5D900; Fri, 12 Aug 2022 09:14:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1660295682; 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=MSZ0DWIerZC+cqcbly9ozwcwybEZ7DsHzAf10DeQ6ZE=; b=TQy4QHONB7TcBXhZTMk2EyAPbRzo+4sqgzcIWiJW0RgmQ+g5U1mBtA+ceA3bTzyBuNjzsf RM945APi4S23hbEXa+YIGzdPUd9Z8LZ8nULiaYc/zBSWzpPG8d6fHCdr3bueXvF/Lv8qy3 fa7woNiAxEig/SKVGZofGbUavyfY16Y= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1660295682; 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=MSZ0DWIerZC+cqcbly9ozwcwybEZ7DsHzAf10DeQ6ZE=; b=aaVRifQ/KXd3VNBTOrPP+CESw/+KHv3pOswAE6yGbrVgUd1PP5OaHoSpwGMOwQPtg9EIo3 INCbZKof9Klpo3Dw== 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 3AA2913AAE; Fri, 12 Aug 2022 09:14:42 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id hqyZDQIa9mL8OQAAMHmgww (envelope-from ); Fri, 12 Aug 2022 09:14:42 +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 0/5] fix validation races and cleanup locking Date: Fri, 12 Aug 2022 11:14:21 +0200 Message-Id: <20220812091426.18418-1-vbabka@suse.cz> X-Mailer: git-send-email 2.37.1 MIME-Version: 1.0 ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=TQy4QHON; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b="aaVRifQ/"; dmarc=none; spf=pass (imf21.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.29 as permitted sender) smtp.mailfrom=vbabka@suse.cz ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1660295684; a=rsa-sha256; cv=none; b=7VtEYrHM1F++F4b5Ieuy7ndAmiNzmbyG2sHYNxKr7A5Hk8vV7C50xb12Ll+wolL4wCslzQ 6ItTfxgLWxTSjvxactiUUNXxSSxyx3H7nlmaYJ7M7uHdXT0J3a4dd+ScgESjWkMaqJ9tii S6zZuLlfpWmHIdiWvM7RLiCuZP7gyS4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1660295684; 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=MSZ0DWIerZC+cqcbly9ozwcwybEZ7DsHzAf10DeQ6ZE=; b=yq/QaUy7TuIEC7Ue8VGV/Ot7eq9i8mO3Fs+Yl1EesHEycTfeYva0yOEhRsCDzQyABheUvf 7j6CX390Z2xhn+V2RMUelnsolyp+cglSCiVfyNzwGKsHG6eIz8rIWwfbotRaSHKcJkUoWd NfqyLYT2CX9RfEmt0DXnR/vL1kTvQOs= X-Rspam-User: Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=TQy4QHON; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b="aaVRifQ/"; dmarc=none; spf=pass (imf21.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.29 as permitted sender) smtp.mailfrom=vbabka@suse.cz X-Stat-Signature: 4gpeytgoggn59rgmb7a7abj7ysqcqon1 X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: EB5141C01C0 X-HE-Tag: 1660295683-352269 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. [1] https://lore.kernel.org/all/20220809140043.9903-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, 252 insertions(+), 165 deletions(-) Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Acked-by: David Rientjes Acked-by: David Rientjes Acked-by: David Rientjes Acked-by: David Rientjes Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com>