Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp652632pxt; Thu, 5 Aug 2021 08:28:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwff+yXsFwIMueYP5gfNKnXmPiIIl/WlAPeaOoYuqvwseIprMn/lNCT3pGxgu1Qgo/SW6EC X-Received: by 2002:a05:6402:11c6:: with SMTP id j6mr7205449edw.349.1628177286292; Thu, 05 Aug 2021 08:28:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628177286; cv=none; d=google.com; s=arc-20160816; b=IJakGTl2UZPrukSEhhX/1U4L0/AebApAaFigd9oFEsfK5AvgDGwcv9Utx80IavIacG E4aIEeY3gg36mmOHmatUPeWtl+IUyREA7tIxSEd6yn6PlH22jQ7Tkm7ZRhVKN1ofoYzE v1Dw2NN4qJ2pf9s2RGFNDxDTmktlgUfUKPgWpkVSTDsXDraJeSDtnz0AIBYLqrzoVSnJ dQ4rDEey4+uPyO8+BbHZz1egfmneMpyx0wK49hCQtaU/NG6f4a9ludLkGJx6ir2cxUd8 9wYtRTamC9Baebt5+dwoJWmG6xtPy4GbLfQFGHjJy2yq5hlU+yzgaNQkGMJEJFhe0bMZ ZU1w== 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=4nLPdoNMTR3WAYWbKJydr/XCafIhyUwKQ/qZPk+fHNA=; b=shSzwGO4P4bZIWfRUV+kIIcdgna9m8iNKYJ+bh4mFGkuhx5oYB1P/HZ+JWYxoqnmoB 8Ym/QGLvmv6kdhb5DyqvhuafKxCsahhYHOFwGYVa+giMCnJ76jQPYQd36MyS7/ZRaZKN CDi2YfJtXCrm8J2w7bj5qBDWoOk8bWtzEK/hV+lcHdtiES6zHi+tB3QcZt7r0gadU9Mr 5bxlHIOFMl71i011nF69dK9PabRRpqfDKsLEcVlyK65wcZwMwkC8RQQQ9+Hk5Bv2lw+R AfFG3JhyYuI3XK443426oBTlkc1k0nlBJ9pO0nXP+kGfa4w72rMPPgzhN5LM9F08TRBe 1Z7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=vI0jrNl7; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=34aTtOzW; 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 9si4540988ejo.527.2021.08.05.08.27.43; Thu, 05 Aug 2021 08:28:06 -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=vI0jrNl7; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=34aTtOzW; 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 S242321AbhHEPZh (ORCPT + 99 others); Thu, 5 Aug 2021 11:25:37 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:59482 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241993AbhHEPUY (ORCPT ); Thu, 5 Aug 2021 11:20:24 -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 12FE420256; Thu, 5 Aug 2021 15:20:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1628176809; 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=4nLPdoNMTR3WAYWbKJydr/XCafIhyUwKQ/qZPk+fHNA=; b=vI0jrNl7ICjCoP6prOSkqOU5/fi0ZRIPwiS1vS7i4KAsBobRPj7VuPVYYWx4xN6V0zI6nR 02NDQpK1tWQVJ++pkvZ3FJXOFI2qv95HuWoHny7oAL/AM/l5OvPlgij2enBf1W1XOqsK+g O/7s3wS7yf+bDdXmFmw7tLd/cZ6TIGA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1628176809; 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=4nLPdoNMTR3WAYWbKJydr/XCafIhyUwKQ/qZPk+fHNA=; b=34aTtOzWYEbtnLDGvSSWnG6/gwUSa7gbzDAEVT676rc59RoTX6xKsK28Eo9UWGwVNKoKnQ CSkcksDlvjsKxxAg== 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 DC29B13DA8; Thu, 5 Aug 2021 15:20:08 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id MCkcNagBDGFDdQAAMHmgww (envelope-from ); Thu, 05 Aug 2021 15:20:08 +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 26/35] mm, slub: only disable irq with spin_lock in __unfreeze_partials() Date: Thu, 5 Aug 2021 17:19:51 +0200 Message-Id: <20210805152000.12817-27-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 __unfreeze_partials() no longer needs to have irqs disabled, except for making the spin_lock operations irq-safe, so convert the spin_locks operations and remove the separate irq handling. Signed-off-by: Vlastimil Babka --- mm/slub.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/mm/slub.c b/mm/slub.c index c8637150bf28..b8581a9b58cc 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -2335,9 +2335,7 @@ static void __unfreeze_partials(struct kmem_cache *s, struct page *partial_page) { struct kmem_cache_node *n = NULL, *n2 = NULL; struct page *page, *discard_page = NULL; - unsigned long flags; - - local_irq_save(flags); + unsigned long flags = 0; while (partial_page) { struct page new; @@ -2349,10 +2347,10 @@ static void __unfreeze_partials(struct kmem_cache *s, struct page *partial_page) n2 = get_node(s, page_to_nid(page)); if (n != n2) { if (n) - spin_unlock(&n->list_lock); + spin_unlock_irqrestore(&n->list_lock, flags); n = n2; - spin_lock(&n->list_lock); + spin_lock_irqsave(&n->list_lock, flags); } do { @@ -2381,9 +2379,7 @@ static void __unfreeze_partials(struct kmem_cache *s, struct page *partial_page) } if (n) - spin_unlock(&n->list_lock); - - local_irq_restore(flags); + spin_unlock_irqrestore(&n->list_lock, flags); while (discard_page) { page = discard_page; -- 2.32.0