From patchwork Wed Jun 9 11:38:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vlastimil Babka X-Patchwork-Id: 12309879 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BAD94C48BCD for ; Wed, 9 Jun 2021 11:40:22 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 56CDD60FD8 for ; Wed, 9 Jun 2021 11:40:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 56CDD60FD8 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 1F7A76B0096; Wed, 9 Jun 2021 07:39:39 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id F16A16B009A; Wed, 9 Jun 2021 07:39:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C7DF16B0096; Wed, 9 Jun 2021 07:39:38 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0149.hostedemail.com [216.40.44.149]) by kanga.kvack.org (Postfix) with ESMTP id 8DE796B009A for ; Wed, 9 Jun 2021 07:39:38 -0400 (EDT) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 22E7B6D7C for ; Wed, 9 Jun 2021 11:39:38 +0000 (UTC) X-FDA: 78233990436.21.FC0317D Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf10.hostedemail.com (Postfix) with ESMTP id 3DFF041AD7B6 for ; Wed, 9 Jun 2021 11:39:34 +0000 (UTC) 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 Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b="K9O/gGfo"; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=sHNNiLfz; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b="K9O/gGfo"; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=sHNNiLfz; dmarc=none; spf=pass (imf10.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.29 as permitted sender) smtp.mailfrom=vbabka@suse.cz X-Stat-Signature: yiqhqr85tsfdkxpa7yw84dn7pxx311n8 X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 3DFF041AD7B6 X-HE-Tag: 1623238774-451943 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: __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;