Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5039343pxj; Wed, 9 Jun 2021 07:50:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzgZXfFMCOWr8gcE3IecK1jHuAW9w39vuEcEHPyL7zAkEg06SVSj4j0Ez24FUCveB07SAkH X-Received: by 2002:aa7:da58:: with SMTP id w24mr22757008eds.127.1623250255433; Wed, 09 Jun 2021 07:50:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623250255; cv=none; d=google.com; s=arc-20160816; b=VcbYkUqEemmHm9u5KZbXYdshDZ/+MGtwYgRnByUpPsYabrS5HYHsYB8mgjJffS1FBM fquYzNEO7Z12u5hCWUI46HZDQk/ueQH7oTsY/I8jEeNvOPb43Z1mJmeLYyawwLlYcxSZ 6r7V+W1RbQAd7p9W+Lvd5szx8JAMUA3zt1pTvmDixWOGewEcjpliojdvKyjp3VQSxtlo RUmEX8KtQR3skui/6e1kCwjA2xp+t37bZvSisT12QqAUIvNEM5KL5yP5NnDHmGOTEENv QuehtawQD2fI8M5YhEEiymVQkiYXkWQaquoSMsOXNr+C/d9GwKoW77bvxRdrbtuKImQR k8kg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature:dkim-signature:dkim-signature; bh=volf3/1v2fagmByxx16yvJir7+qLZbMW6i+3I7p6Sqc=; b=G7pwh7gSXs7qVYGx6cAhjTE6GLe5ft+bCLsV+FoY05pe2H1nTIn5VttRomVFAQ1J6D kW8zvQfEQTqWRBQmZ4rsDcSNr2FcjIedlziHzBOZTYad5z8Qww5X891zcIJgkCLohZd8 9Qq6kQIErlgew+Aw1nlgUTWlahjzN1cNLEQoxiMVpI6fThbWXB0his+JlqEW+LYKgyaI l2Y5QV5ayh9C3iWQivm4E0RgUVD80XvermVH6NY/g6yHKCuyVm5sFSxQCSd+T3fPR9r6 vfirQ77dcmqmsvSaTqJicm5COjvaMLSq/IlbquxGeTH7ZfLwTBFQUaVTgKwU7SGid08W PAqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=lr54bFG1; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=wA99Gg5P; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=lr54bFG1; dkim=neutral (no key) header.i=@suse.cz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hp6si23708ejc.697.2021.06.09.07.50.31; Wed, 09 Jun 2021 07:50:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=lr54bFG1; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=wA99Gg5P; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=lr54bFG1; dkim=neutral (no key) header.i=@suse.cz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239338AbhFILmk (ORCPT + 99 others); Wed, 9 Jun 2021 07:42:40 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:47072 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239054AbhFILla (ORCPT ); Wed, 9 Jun 2021 07:41:30 -0400 Received: from imap.suse.de (imap-alt.suse-dmz.suse.de [192.168.254.47]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id E25B21FD6A; Wed, 9 Jun 2021 11:39:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1623238774; 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=volf3/1v2fagmByxx16yvJir7+qLZbMW6i+3I7p6Sqc=; b=lr54bFG1gI4xnJeu9xxylzjCxMUOqNqFn/br4xXHq81J69rcBsj28VivKVSEAEArKZDAqs h4rhgbwAeCs851IARKYZ+p4ZCItRK5L6PHtYZxVglhNAxtFCxN+fYOeSoYthoCHh6aWBOj JWWQgmM/g94TpKtwJNw/LbxsKiSgcVc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1623238774; 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=volf3/1v2fagmByxx16yvJir7+qLZbMW6i+3I7p6Sqc=; b=wA99Gg5Pd7WMagaeXluGX6o8cRtQqRLxmU2ZtrWMN2q8RXGYk1MIWLpRajaR3MkBkyPGrN cG2wR3V0vN3R36Cg== Received: from imap3-int (imap-alt.suse-dmz.suse.de [192.168.254.47]) by imap.suse.de (Postfix) with ESMTP id B391D11A98; Wed, 9 Jun 2021 11:39:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1623238774; 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=volf3/1v2fagmByxx16yvJir7+qLZbMW6i+3I7p6Sqc=; b=lr54bFG1gI4xnJeu9xxylzjCxMUOqNqFn/br4xXHq81J69rcBsj28VivKVSEAEArKZDAqs h4rhgbwAeCs851IARKYZ+p4ZCItRK5L6PHtYZxVglhNAxtFCxN+fYOeSoYthoCHh6aWBOj JWWQgmM/g94TpKtwJNw/LbxsKiSgcVc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1623238774; 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=volf3/1v2fagmByxx16yvJir7+qLZbMW6i+3I7p6Sqc=; b=wA99Gg5Pd7WMagaeXluGX6o8cRtQqRLxmU2ZtrWMN2q8RXGYk1MIWLpRajaR3MkBkyPGrN cG2wR3V0vN3R36Cg== Received: from director2.suse.de ([192.168.254.72]) by imap3-int with ESMTPSA id ONReK3aowGD6XgAALh3uQQ (envelope-from ); Wed, 09 Jun 2021 11:39:34 +0000 From: Vlastimil Babka To: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Christoph Lameter , David Rientjes , Pekka Enberg , Joonsoo Kim Cc: Sebastian Andrzej Siewior , Thomas Gleixner , Mel Gorman , Jesper Dangaard Brouer , Peter Zijlstra , Jann Horn , Vlastimil Babka Subject: [RFC v2 17/34] mm, slub: check new pages with restored irqs Date: Wed, 9 Jun 2021 13:38:46 +0200 Message-Id: <20210609113903.1421-18-vbabka@suse.cz> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210609113903.1421-1-vbabka@suse.cz> References: <20210609113903.1421-1-vbabka@suse.cz> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Building on top of the previous patch, re-enable irqs before checking new pages. alloc_debug_processing() is now called with enabled irqs so we need to remove VM_BUG_ON(!irqs_disabled()); in check_slab() - there doesn't seem to be a need for it anyway. Signed-off-by: Vlastimil Babka --- mm/slub.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/mm/slub.c b/mm/slub.c index 378f1cb040b3..760080b58957 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -954,8 +954,6 @@ static int check_slab(struct kmem_cache *s, struct page *page) { int maxobj; - VM_BUG_ON(!irqs_disabled()); - if (!PageSlab(page)) { slab_err(s, page, "Not a valid slab page"); return 0; @@ -2729,10 +2727,10 @@ static void *___slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node, lockdep_assert_irqs_disabled(); freelist = get_partial(s, gfpflags, node, &page); + local_irq_restore(flags); if (freelist) goto check_new_page; - local_irq_restore(flags); put_cpu_ptr(s->cpu_slab); page = new_slab(s, gfpflags, node); c = get_cpu_ptr(s->cpu_slab); @@ -2742,7 +2740,6 @@ static void *___slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node, return NULL; } - local_irq_save(flags); /* * No other reference to the page yet so we can * muck around with it freely without cmpxchg @@ -2757,7 +2754,6 @@ static void *___slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node, if (kmem_cache_debug(s)) { if (!alloc_debug_processing(s, page, freelist, addr)) { /* Slab failed checks. Next slab needed */ - local_irq_restore(flags); goto new_slab; } else { /* @@ -2775,6 +2771,7 @@ static void *___slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node, */ goto return_single; + local_irq_save(flags); if (unlikely(c->page)) flush_slab(s, c); c->page = page; @@ -2783,6 +2780,7 @@ static void *___slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node, return_single: + local_irq_save(flags); if (unlikely(c->page)) flush_slab(s, c); c->page = page; -- 2.31.1