Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp6094455pxv; Thu, 29 Jul 2021 06:24:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwHnVA8gVFtj03rxHeS1d1xOh49zGOvfQXJZN3Ib8IquD6wPaxXg2yQUXCfVeb4RRS2oxCo X-Received: by 2002:a92:d6c9:: with SMTP id z9mr3639677ilp.134.1627565082692; Thu, 29 Jul 2021 06:24:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627565082; cv=none; d=google.com; s=arc-20160816; b=WaL6bAFnUKGez1i76y4b60hWqc93yxrdZfYKpeoGZniK9gkSJ5SInllGTh/4F2XtYP 6S/22iDdKW3VaQuvlBAUOooOPPak3kSlKGkVbDQCAhdApb87KwOewXoH6O/tTgvo/COv sYOA/oGhOQrb7uzZesLMc0J9zuIjToaW85HVprEmZV3sEb0r6D+ghpPD6Cq+Wb/fGtoG cZh0LtY/lpmX8MzSa4rFnkKYnsQnz/MpXtr9KVzLa8cB2ZGwWyoeidwTNrRXuslx6inL YtZ++wg9i5Hele6WCf3O0IXHreSsekENmGcQ0hSQD4cvLJz712WvLsGibiDWPMqVpZEc RazA== 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=Z2azoHU0llGNdleUCDO+FUVB6LKtlo/CQvtZYYgr7n0=; b=0ZKxwhTfc3dS9GvV9A03iZWjYujQ62b93VhqEo66n7bd82HklnYzGel9lZNlRNn/cY FDpYFitnTuBKo33WWHQW+SK3NkpSshREi6rw9Ir/JMhKkIa/TS0TJlGtYsB6F75i9/zr BWrlHlIlAQFH+OyI84ssrBcTbWS3ptnqUZXWIgi69ULJzqPufVrG6bd4L5Y8aGGx2v6P Fiba9tDuwp2EXgQHDZWFWSuIGczHBbWF+bWMmpW98YtHPHVvnDEIK5nTGjdQ6LINOyub O32jSwiJKSVCRtmZaRvmcJeiHqKOQgxsl1o++jBYYelmkydQsi6VLjyYOHY2wIEY2eqs PZCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=nlMMFYkc; 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 w12si3064582ilv.127.2021.07.29.06.24.31; Thu, 29 Jul 2021 06:24:42 -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=nlMMFYkc; 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 S237786AbhG2NXX (ORCPT + 99 others); Thu, 29 Jul 2021 09:23:23 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:38686 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237550AbhG2NVt (ORCPT ); Thu, 29 Jul 2021 09:21:49 -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-out1.suse.de (Postfix) with ESMTPS id 51E7D223CE; Thu, 29 Jul 2021 13:21:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1627564905; 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=Z2azoHU0llGNdleUCDO+FUVB6LKtlo/CQvtZYYgr7n0=; b=nlMMFYkcDSjCg5wIpz5/hvs13e9BT2lHYHhKBxEA49e9oEJJ9+rO5fL5vdB3/Mj8KXiA6j U3l/MrmyD9icTM81yZh0sAbfs7Z32wf9Lmzdse5xxq87mzowDGBb73nSt9aZjpkkipWfyT f97/8ZUsB8//6JxW606fSBRM2nkDHGw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1627564905; 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=Z2azoHU0llGNdleUCDO+FUVB6LKtlo/CQvtZYYgr7n0=; b=g0V9Hr+4NmiqPtz3EyAy7p+nPFhD7GN37mdIE910tLNjE88ZeTp5LY4VZlGfLUqXMd720e PnYWc9zlo050cXBg== 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 259D013AE9; Thu, 29 Jul 2021 13:21:45 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id OJt+CGmrAmF9AwAAMHmgww (envelope-from ); Thu, 29 Jul 2021 13:21:45 +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 26/35] mm, slub: only disable irq with spin_lock in __unfreeze_partials() Date: Thu, 29 Jul 2021 15:21:23 +0200 Message-Id: <20210729132132.19691-27-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 __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 dba13cd8ca1c..2208be8af7a5 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