Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3846912pxj; Mon, 24 May 2021 16:44:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy2q4D82bx8RSJCZ3pcZ5PNlujQTXTyYShVdWR2Alx+GJ8OF0322J+GLxS/RLibzVbecYUU X-Received: by 2002:a17:907:961e:: with SMTP id gb30mr26720945ejc.58.1621899879258; Mon, 24 May 2021 16:44:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621899879; cv=none; d=google.com; s=arc-20160816; b=rxBhHroWAkMs6J/ZzubtXSZ5ArNIjDEr+E4lJBc+sUURbTWeK/SAbwjtI9B1sf7i/q fzZWjJ0nfu9BGHM+hkdk4/3drFeYG+QdwZsE8xY9ybsREf2/IX14Jn8qKyorbbqNdpDb SrmzHCkzZ+xq7LNGQBs4zcSz+/RdTdW7pr+ClhX3s5tfsf7AQVOO0tR14rxo8dMpvnfe f+Hzh1tjUih2JY3VQTE/2+Kq6M7rquvb9QOKVP+NRK5gO/fjdQtVuLSuLfDw068F8dSI Hh2tMVXpaYJyB2D90PaV2Hla9F1/gnfc7y4XXMmGVCdBDFnFDW7H1DSlWnz0YqHzJ8pq ZoWg== 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=CnNm0iY5pSNdSsgQsGWH59GnT8BarWDV5JB92qo6F/w=; b=kkf8k24/FOwr2rG8hbrVrmvdM8Lybh3Lm0Vm67iZWLqi4CKf4aoJCa1bRcPsLrVVzP ehoW6ktMi033lLBcT8msJaM1rrGic/X4BiK3z1cFYL+/4689kcuHOhIYhkempCR12+IM 5vJnfN4cmoaS7JgR4iqbj5ManmT2ZcyE9YU/oH/E1I/IFqIFD8ExNoyIF/qshGVvhDih /q3ZAuprWyTE7rUkEbuV0PRerkXFh/h2kmAzX2+QkxGr5QEZat9g6jsY+cEBHKO6eEwa KZRVAYn193hTs2NI9qvugO5NGTBzRDXniIqytWcO6GXOey227xHFxLB+JBH1hgfF+ZQ4 +lzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b="krSmb/FW"; 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 v3si13877727ejb.173.2021.05.24.16.44.16; Mon, 24 May 2021 16:44:39 -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="krSmb/FW"; 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 S230487AbhEXXoE (ORCPT + 99 others); Mon, 24 May 2021 19:44:04 -0400 Received: from mx2.suse.de ([195.135.220.15]:50900 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229975AbhEXXmW (ORCPT ); Mon, 24 May 2021 19:42:22 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1621899649; 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=CnNm0iY5pSNdSsgQsGWH59GnT8BarWDV5JB92qo6F/w=; b=krSmb/FW++uH5rHIZmqepy2/H2lFbnN413ES9lvl9bpwCmkTzpdeinPHgm/RMAI7Tn6zH3 8Qnl4A5iY8zm3XMCimtm6Thv2rT0twz9iDa5LqTXTSqeiyxde3bR8LygKvaMZ3XQietT7r Tis8TxMVgDe1Qf6RpU25VPnFpTKlhEg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1621899649; 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=CnNm0iY5pSNdSsgQsGWH59GnT8BarWDV5JB92qo6F/w=; b=mHcFT9ijUrzpjZt+cRXpwCpYqyelw1+gaq0LTgFfSta+Ia+xkxSvEj9ZN8MtjnH9oOgw/j PSzIEceIVPbD9BCw== Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 9CC44AF4F; Mon, 24 May 2021 23:40:49 +0000 (UTC) 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 23/26] mm, slub: only disable irq with spin_lock in __unfreeze_partials() Date: Tue, 25 May 2021 01:39:43 +0200 Message-Id: <20210524233946.20352-24-vbabka@suse.cz> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210524233946.20352-1-vbabka@suse.cz> References: <20210524233946.20352-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 92345d3840d1..aee83758bbc4 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -2306,9 +2306,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; @@ -2320,10 +2318,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 { @@ -2352,9 +2350,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