From patchwork Sat Sep 4 10:49:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vlastimil Babka X-Patchwork-Id: 12475487 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1EDCAC4332F for ; Sat, 4 Sep 2021 10:50:18 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B8B6A61175 for ; Sat, 4 Sep 2021 10:50:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org B8B6A61175 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 887986B0072; Sat, 4 Sep 2021 06:50:12 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4BF4F900003; Sat, 4 Sep 2021 06:50:12 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 00991940007; Sat, 4 Sep 2021 06:50:11 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0055.hostedemail.com [216.40.44.55]) by kanga.kvack.org (Postfix) with ESMTP id B0D1D940007 for ; Sat, 4 Sep 2021 06:50:11 -0400 (EDT) Received: from smtpin32.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 6F81B2FE11 for ; Sat, 4 Sep 2021 10:50:11 +0000 (UTC) X-FDA: 78549571422.32.E67D40F Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf06.hostedemail.com (Postfix) with ESMTP id 1D4C9801A8A3 for ; Sat, 4 Sep 2021 10:50:10 +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 094B320042; Sat, 4 Sep 2021 10:50:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1630752610; 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: in-reply-to:in-reply-to:references:references; bh=AKjA7zkK2CiQbcxckmj6PgA4IP+98uIsMfY09GmbqeY=; b=Ub8G6DjjBlfkUZvruB3E0xZAbPTLfniYqZgTDMuIsL7fWRgBgMeS4PtBsYgEd9BuqUO7/5 +CKUTgr83ZtXodhDyGTWRT6RkO6qjehA+sTRu9QbBwWmQ0OPNiC8IgiCtVSWApppM65SWZ EBeigD9mB/h4iX16yfLvqgnJIA1QahE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1630752610; 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: in-reply-to:in-reply-to:references:references; bh=AKjA7zkK2CiQbcxckmj6PgA4IP+98uIsMfY09GmbqeY=; b=JxOTilqiqRzEvNls77I9hgHMMomSg/ByI6XF8u+gaUF9R7M1dEy8NNRniwW+lo4DvJpGCP 36DXZkYg4SP/HsCA== 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 D0FF31348A; Sat, 4 Sep 2021 10:50:09 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id MEA/MmFPM2HoUQAAMHmgww (envelope-from ); Sat, 04 Sep 2021 10:50:09 +0000 From: Vlastimil Babka To: linux-mm@kvack.org, Christoph Lameter , David Rientjes , Pekka Enberg , Joonsoo Kim Cc: Andrew Morton , linux-kernel@vger.kernel.org, Mike Galbraith , Sebastian Andrzej Siewior , Thomas Gleixner , Mel Gorman , Vlastimil Babka Subject: [PATCH v6 04/33] mm, slub: don't disable irq for debug_check_no_locks_freed() Date: Sat, 4 Sep 2021 12:49:34 +0200 Message-Id: <20210904105003.11688-5-vbabka@suse.cz> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210904105003.11688-1-vbabka@suse.cz> References: <20210904105003.11688-1-vbabka@suse.cz> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1375; h=from:subject; bh=Vn7eJ9KAIZUTN+3Dx8m9mW+i4oc+6Mw3YYkJSqJhCjU=; b=owEBbQGS/pANAwAIAeAhynPxiakQAcsmYgBhM08PgOrLSR+eZW5rSb1I27grjcg4iQU56SPcFqkq KfGE8WSJATMEAAEIAB0WIQSNS5MBqTXjGL5IXszgIcpz8YmpEAUCYTNPDwAKCRDgIcpz8YmpEAhKCA CWVTGnWCC2oYF/FiXhqxyhSflb1q6SrhG+lT0vwOkheMrNWQPDhOcPra7CpT4vPJmJxMJT8lG8AKY/ axMlGEg60GXL+e/GrPfaRKnRBecEgEDkQhw5RdzE4ISSkIFABdNRy2SzgPJ7Um1C9u8IQVNmxm4d9R vf+L9BZpTW4cIbLkSHpqrujwU/lHx1zHGui9Bfuiq2xyw2wi3wI3mEyNsSTgpykr0c0aoqysYcwM9c s14gQ/a3uZwVUj4ucC8+3cuK0LKKKSIXmjyHvI57yP1a+CkNTvSN0lHoD1xBPYpIpqR8ZxhzpPcysU 8BTWTSJI8ueyMiuFNIMC5rTd7D5aFQ X-Developer-Key: i=vbabka@suse.cz; a=openpgp; fpr=A940D434992C2E8E99103D50224FA7E7CC82A664 Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=Ub8G6Djj; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=JxOTilqi; 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-Stat-Signature: sn93toto46oa3nrrmrnmzqu6jsm41anb X-Rspamd-Queue-Id: 1D4C9801A8A3 X-Rspamd-Server: rspam04 X-HE-Tag: 1630752610-464500 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: In slab_free_hook() we disable irqs around the debug_check_no_locks_freed() call, which is unnecessary, as irqs are already being disabled inside the call. This seems to be leftover from the past where there were more calls inside the irq disabled sections. Remove the irq disable/enable operations. Mel noted: > Looks like it was needed for kmemcheck which went away back in 4.15 Signed-off-by: Vlastimil Babka Acked-by: Mel Gorman --- mm/slub.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/mm/slub.c b/mm/slub.c index 4697280130f2..fee093db2bfd 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -1591,20 +1591,8 @@ static __always_inline bool slab_free_hook(struct kmem_cache *s, { kmemleak_free_recursive(x, s->flags); - /* - * Trouble is that we may no longer disable interrupts in the fast path - * So in order to make the debug calls that expect irqs to be - * disabled we need to disable interrupts temporarily. - */ -#ifdef CONFIG_LOCKDEP - { - unsigned long flags; + debug_check_no_locks_freed(x, s->object_size); - local_irq_save(flags); - debug_check_no_locks_freed(x, s->object_size); - local_irq_restore(flags); - } -#endif if (!(s->flags & SLAB_DEBUG_OBJECTS)) debug_check_no_obj_freed(x, s->object_size);