Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp651882pxt; Thu, 5 Aug 2021 08:27:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzvFJcX4cepU4xd/MCFmLAvJXR9+cWe9cG1GoJBPDNtI3G8J6d0r/Rmi67sSxlpU5s9tKnu X-Received: by 2002:a5d:93d3:: with SMTP id j19mr688599ioo.184.1628177224119; Thu, 05 Aug 2021 08:27:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628177224; cv=none; d=google.com; s=arc-20160816; b=Xr5oM67UieSxbkEBt1vuyNuNUVvguUh8bS9hdruiUqgubrVs7lqUSHj4MFMDoIPfMR 6Yz3Gjk8SmlNyruqDVD3LbluwRBw7F8C/BhoKUtQzCTBroR2Gd2LicGml0I/uLeSSto8 I0UTuzOGYT2JJmLZq6dW/IykUATELmk7Vg9E5ITSFt0DKdVGySEllXibP7RZe5NryNWF hJ5ijGv4C2NihD4ak9g6GybDLm7UZx8jWN4erzvJ008DRK6nA2S9YCyBoFFkz85ggNXE E2ZsMY/FFoBW4S+IX/NFXDwoZVYi6tV6EdS/WjmMPN5FGToZF1upSgiQmzxpJP5nXeYL k+Wg== 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; bh=DX6pyctjubalDvpaFc959w9rTMQLVCkPm5JsZTE6JMs=; b=fmEV9Nb/+/ZKlDJJ+XQ1/V/T7gR26SIcM36WzhRS5It2HvkBo1NDKudnpG/kDroyjG 8QMPAClK6iiueoqup5XOAPvf7kvaoib+CoSd47cWQlrC5fAylQ0r2doL31HVhueOb1qF IrYAP5AoBg+W0CeJ0Qaf5Cf2F0hkJcmIgNZcIDMFzwoLEHlg2YjVQt8V3Oo3cgkqQ5NX BwgpwUZJTxpVlZwVVU0uHQLLMnKxgtOqqIbRc6XRRv2pQGHLKFSY1OsJtVNWnhOrXm6L vYUDltxTu46j5GiOHcuZFk4oIKIOC9+p8y3qtQcAMIKcvtGG6ehUe6jv88fDkC6KqgM3 3ZIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=LG8ndwon; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; 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 15si6718601ilz.158.2021.08.05.08.26.52; Thu, 05 Aug 2021 08:27:04 -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=LG8ndwon; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; 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 S233419AbhHEPZE (ORCPT + 99 others); Thu, 5 Aug 2021 11:25:04 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:34126 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241965AbhHEPUW (ORCPT ); Thu, 5 Aug 2021 11:20:22 -0400 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-out1.suse.de (Postfix) with ESMTPS id 57287223E1; Thu, 5 Aug 2021 15:20:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1628176807; 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=DX6pyctjubalDvpaFc959w9rTMQLVCkPm5JsZTE6JMs=; b=LG8ndwonOR6DhV4panVHw8n6yy+sXb2XEPQT9IPdbgbJvH7dbexW340E8mz1IEu9T0c9e6 snfMzYefNYDXrgBDbI/iBRgertb+VJ/IzxV2XBdHiTnWRv2cla0SOflpsNBt3Z21gRmry7 Q2ZL1C2KoJXZhB9dJmvucIE/kd+FSDg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1628176807; 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=DX6pyctjubalDvpaFc959w9rTMQLVCkPm5JsZTE6JMs=; b=lqadEc618KD9s96uzojTzSSC6P/zycF+xjwOmX5HVWM8Zry7RgzhbBgP+Kwq1qkd2rh4Ks r/ZbT1SqW9l+2eCg== 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 2BAC013DAC; Thu, 5 Aug 2021 15:20:07 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id sLYCCqcBDGFDdQAAMHmgww (envelope-from ); Thu, 05 Aug 2021 15:20:07 +0000 From: Vlastimil Babka To: Andrew Morton , Christoph Lameter , David Rientjes , Pekka Enberg , Joonsoo Kim Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Mike Galbraith , Sebastian Andrzej Siewior , Thomas Gleixner , Mel Gorman , Jesper Dangaard Brouer , Jann Horn , Vlastimil Babka Subject: [PATCH v4 17/35] mm, slub: check new pages with restored irqs Date: Thu, 5 Aug 2021 17:19:42 +0200 Message-Id: <20210805152000.12817-18-vbabka@suse.cz> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210805152000.12817-1-vbabka@suse.cz> References: <20210805152000.12817-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 5d58fde2bd70..f7c6cebb524d 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -995,8 +995,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; @@ -2772,10 +2770,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); @@ -2785,7 +2783,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 @@ -2800,7 +2797,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 { /* @@ -2818,6 +2814,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; @@ -2826,6 +2823,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.32.0