Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp6093790pxv; Thu, 29 Jul 2021 06:23:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxGW1izreiMbMXlnfQBibHEnsbW+ogrv1ymPeS6s5jIp4MzxvyxCZhwcgPP2Gc0Eq1EEKix X-Received: by 2002:a92:c502:: with SMTP id r2mr3629939ilg.140.1627565034268; Thu, 29 Jul 2021 06:23:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627565034; cv=none; d=google.com; s=arc-20160816; b=nY+LgcaSDUFJ8S6lW/e+SbCveRjFSP45QWCKpuIEgoozD2xBiOev6ymeyCbPTAm9XE tY/oongwgvVXGta9T9zbIevH9Yj+Gk0lf8p5D70vS7rhYtKokM64GLIJRD06vOZXkKZA 2cTC1vkpyALTdMSJeo601CS/a2SrcPlYCXs5VosLnRx+cSfZXNsOz+35kz7tI67bS5O3 O99NdI/crmG44l1+d+hAdoKYGohX2wp3p8+lEKbLsEnxuK3RxWl103L21ubPiSLSdR0S PuwXfvAJu+CJkxb60XnbkCIUGdrIXhNqG6HGgpX2BOl1NnT9DbxWbA5AgzGELn6LtWVz cUGw== 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=7D4gi9Ymm/JtjOgio23z86mac5EswQa3LXKOhbrYygA=; b=UWtdocEHF9f72wN6+1bJGz8WJZ/EAR8VQsFP+zrG/vayriPKUuS6IqQSm/WFLYAV2M Y1ZMEBD2CQ1N6M3AX2spkwrt/ePHZh7tOAdEp387FejTKA6EF56DmBd4VIi6rZgHZNqo 5bBArVQjhXXvkBwNoz/0hwIAKZgoCynWve5HFSPuJ4ctx2G3RdTPcooMb/SNvUaOJlfM 3juYAWAMBPQzPrxq8VUxY1ISqOXubop33w9U5QOeEyokDDfQO+mjrs44Q1qOAoRGA78P 2C9t4jt5gFRDbnZH5obPKDW2L3JUn2SpvYdAA6ZeY8Gt/OSw8TFSq80EaSUb6+wzQGoG hokg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=P+uZ6ZoB; 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 i186si3429605ioa.76.2021.07.29.06.23.43; Thu, 29 Jul 2021 06:23:54 -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=P+uZ6ZoB; 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 S237696AbhG2NW2 (ORCPT + 99 others); Thu, 29 Jul 2021 09:22:28 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:56744 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237496AbhG2NVr (ORCPT ); Thu, 29 Jul 2021 09:21:47 -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-out2.suse.de (Postfix) with ESMTPS id 93F6B20040; Thu, 29 Jul 2021 13:21:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1627564903; 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=7D4gi9Ymm/JtjOgio23z86mac5EswQa3LXKOhbrYygA=; b=P+uZ6ZoB1uB6S+r6sg08M6pC3HoodN5uPvtF0Vtu/nCQf1C60XCDJtWYl7nQAod7pdzzHo W5xnmOCQ9Z3JlHJe7+Wwvun9mRekwFFiOvfh+k9hlbbt9SYRrV96xe2wW9U2Q8OQtmhtF8 86HipLNdCv1dNkApugHu+r0PAePL7fs= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1627564903; 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=7D4gi9Ymm/JtjOgio23z86mac5EswQa3LXKOhbrYygA=; b=em0+wF63ecfijpHaGdSCoalSP1FWnGj4TOMOxGq4hcsQxAwl4AKOCAQF+z0Sow3pMN+Qfw B6BvNPxYi3TKI3Aw== 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 6855E13AF4; Thu, 29 Jul 2021 13:21:43 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 6Li0GGerAmF9AwAAMHmgww (envelope-from ); Thu, 29 Jul 2021 13:21:43 +0000 From: Vlastimil Babka To: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Christoph Lameter , David Rientjes , Pekka Enberg , Joonsoo Kim Cc: Mike Galbraith , Sebastian Andrzej Siewior , Thomas Gleixner , Mel Gorman , Jesper Dangaard Brouer , Jann Horn , Vlastimil Babka Subject: [PATCH v3 17/35] mm, slub: check new pages with restored irqs Date: Thu, 29 Jul 2021 15:21:14 +0200 Message-Id: <20210729132132.19691-18-vbabka@suse.cz> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210729132132.19691-1-vbabka@suse.cz> References: <20210729132132.19691-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 c1a88ad4048b..fe0594b60e93 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