Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5154273pxj; Wed, 9 Jun 2021 10:20:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyDGm3g2IDK8IWa6vzSZrhP3PQPDoixKSpTmubKEIGlLhw4RH3zOTzv5dDwJPXFosdpafc8 X-Received: by 2002:a17:906:560c:: with SMTP id f12mr846933ejq.503.1623259228113; Wed, 09 Jun 2021 10:20:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623259228; cv=none; d=google.com; s=arc-20160816; b=SDNzbnvGLEocImYd8Los6dInhNsR2f83BaoKiCyqQE26houz5yEUJ9du+TpVmNCZIg xN11VPggJR2OADyvA9aLnh6go4n0BdJniL6gifrRRwwz5/Z+B9fuBvgSmU5uqPBKWTHN u63uatpIToHn/FhlNDD6VIe7zam7Dg/UvyulsWGVydmmDgVtbjlYLnxokZFTdMNqVWAp TbOn6ViLTedayrySzc16GXqRLp6gGBiSaAiRZnujW/6LZGEQTHvc+3zHdigmCUBhFvnr qyu574YVgPMPrVwd+CMS5hFh2YE8jIsp+zyruoHZtd8vtbhRoJgYBSA0bz80Jf2RJPiq tKmg== 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=zyVMd6JuJll2CSwZVtypUoJOKYt0RuiadUow3LJITGI=; b=L4HdVUoHTys7FVOpOA2eWnqXZhYZwBTBRU0S9/IziAoRnrbfJWAdk3noL4h0pt3hVL hNZrYF9CHEkrGKdi1AZnpsRoxnJrfdANJlQFq7QKUVMaan0Mk4Hyy7xAVC4mGZA8FZCX 1gvWp3bne7uB4fPktv9NmkPBf2M/KXCrwlFZjR7OGkucrvZexFW2is64oNCzmkaiDSrJ ImY1zG0PuWb0p08a8AJEnvl0A+ZXJGlR7HR/mHFt5YKkJTZKgyCdS+qAVOc+lpvqwvTt Tf6W0/Kaq52/iaFfF9aKxhaf6QX2qxo0Fgc/70Bne+Da/L0YtA0GhvbBvfi2bo7KSiVs WaoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b="K9O/gGfo"; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=sHNNiLfz; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b="K9O/gGfo"; 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 kl25si290034ejc.370.2021.06.09.10.20.02; Wed, 09 Jun 2021 10:20:28 -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="K9O/gGfo"; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=sHNNiLfz; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b="K9O/gGfo"; 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 S239464AbhFILnd (ORCPT + 99 others); Wed, 9 Jun 2021 07:43:33 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:47170 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239191AbhFILld (ORCPT ); Wed, 9 Jun 2021 07:41:33 -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 B42731FD6F; Wed, 9 Jun 2021 11:39:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1623238776; 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=zyVMd6JuJll2CSwZVtypUoJOKYt0RuiadUow3LJITGI=; b=K9O/gGfopsAbKUt5QoB/ur6B/XWNA+WamO+Tjd+gPPbho3pCYARNDp9aMd4AkxtiKpi5Ho CoP6+KqI4DpOC6prRlGDaOx+ewgETUeIN4lv3ZYe2ZIqpPY2egb93A7YJ8lCnw0e2zyEtZ Xgq9+5FFac3bkwvlt58AX11q59y1ni0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1623238776; 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=zyVMd6JuJll2CSwZVtypUoJOKYt0RuiadUow3LJITGI=; b=sHNNiLfzjvpwDljIQ60meButSP0QmB0R/YE2ciWU7SwTf853LSAJMxDxQXgzVDIcjGgsML 8xgYX5GqnfTakBCA== Received: from imap3-int (imap-alt.suse-dmz.suse.de [192.168.254.47]) by imap.suse.de (Postfix) with ESMTP id 82B51118DD; Wed, 9 Jun 2021 11:39:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1623238776; 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=zyVMd6JuJll2CSwZVtypUoJOKYt0RuiadUow3LJITGI=; b=K9O/gGfopsAbKUt5QoB/ur6B/XWNA+WamO+Tjd+gPPbho3pCYARNDp9aMd4AkxtiKpi5Ho CoP6+KqI4DpOC6prRlGDaOx+ewgETUeIN4lv3ZYe2ZIqpPY2egb93A7YJ8lCnw0e2zyEtZ Xgq9+5FFac3bkwvlt58AX11q59y1ni0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1623238776; 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=zyVMd6JuJll2CSwZVtypUoJOKYt0RuiadUow3LJITGI=; b=sHNNiLfzjvpwDljIQ60meButSP0QmB0R/YE2ciWU7SwTf853LSAJMxDxQXgzVDIcjGgsML 8xgYX5GqnfTakBCA== Received: from director2.suse.de ([192.168.254.72]) by imap3-int with ESMTPSA id gI9xH3iowGD6XgAALh3uQQ (envelope-from ); Wed, 09 Jun 2021 11:39:36 +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 26/34] mm, slub: only disable irq with spin_lock in __unfreeze_partials() Date: Wed, 9 Jun 2021 13:38:55 +0200 Message-Id: <20210609113903.1421-27-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 __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 0867801e3086..5a81189608e6 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -2292,9 +2292,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; @@ -2306,10 +2304,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 { @@ -2338,9 +2336,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.31.1