Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5040010pxj; Wed, 9 Jun 2021 07:51:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyIZ9N3Zp0kxRJiOS5S/sGyruObRQafD0eXZEiVpydDn1fdgqFwM6NFCyPOOp8uGVlgZqsm X-Received: by 2002:a05:6402:22f3:: with SMTP id dn19mr31004118edb.240.1623250312082; Wed, 09 Jun 2021 07:51:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623250312; cv=none; d=google.com; s=arc-20160816; b=GiaMnkoqBcIcWv2DIsYCAlPfSipbLnxv8cT4nqtujymvmMkqC8Nuf5V59OMb/s32Ts 1GeIbw0EjTNe/BS45bswGSTntGOdY5bRxgJ5AEJ9qENHmjauZW8quzN+oGHhMU87vTKh KflqjehypclB6cVT7A8NQbc5b6IiLOia3jXx0jtS+G7hm59kz4Hp1wzYv3YTxw3VzQSe ld35RdAEZgLnuKu9mUH+zzcz3k3b8jdDPCoSECPalq9yWrecCI4IgEo70T+BRY4UEZgS r52wtQwY/G9X0AF3o+Sfydr576bUFELjdXn9uB689ttGV+6RtgRnS7lH/U2TSdnrm58f oijA== 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=tbfCejBm4aJ4eyiGJzBDybVMR3HougtHgUCP1fs72bo=; b=lTxzM9bMr/WgznYqstA8giSPqh7okyC51BUUdC5ZWUbcyeWRiO4tNE1paQh79A9ETv QFCVJLyg/0vwfT1xYBBVEEVIyuRXdx3ce4k5q2ticwzImRZiJJ1OjRcPOnCKhWqYMy5M kQxOPhMkRdu28U6/pprRACrsrk1i+HmJ2Yy3Y0GJ7hU7iq1/LC2iV8tQgKhIjiihaEy+ NFYstwv5yDIYIoaQls42qv7EFDdRjDK0rTsqym6LYrbxUq88LhCji4I3g+T5//sFbtbx +/TWHWz0RmaSqeB/HrTWfJnicHun8JSoVvbWm4OBMI8KcK/7DtyYWv0SNKvDaVnA5/sJ zEDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=abQ+3zq7; dkim=neutral (no key) header.i=@suse.cz; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=abQ+3zq7; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=bqh+vEXL; 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 g11si2474612edw.414.2021.06.09.07.51.27; Wed, 09 Jun 2021 07:51:52 -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=abQ+3zq7; dkim=neutral (no key) header.i=@suse.cz; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=abQ+3zq7; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=bqh+vEXL; 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 S239054AbhFILnB (ORCPT + 99 others); Wed, 9 Jun 2021 07:43:01 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:47070 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239162AbhFILlb (ORCPT ); Wed, 9 Jun 2021 07:41:31 -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 84B1D1FD69; Wed, 9 Jun 2021 11:39:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1623238774; 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=tbfCejBm4aJ4eyiGJzBDybVMR3HougtHgUCP1fs72bo=; b=abQ+3zq7aibBT/g90YxFKE7rlf+NZ9S9FZTxwKAh2QuzmHAYSsa8uB5EK/eiHpxrHVrPxq pgjW2LElsW0P+47Y+kCK7ikqyJsPBOZvoJKHKcxqiVqsGrH2Qoat0SQPh+TJAnsFRSyH+B AjgejlpHfvZzB4AoT7DbzQM4CynrS/I= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1623238774; 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=tbfCejBm4aJ4eyiGJzBDybVMR3HougtHgUCP1fs72bo=; b=bqh+vEXLGfW4VC1I3METAhg3INHSZVUllLrlgqb3HKqRkpcukg/2P3UhNoA4Ky7WoOrqok A7E8UUQ37dmjHKBA== Received: from imap3-int (imap-alt.suse-dmz.suse.de [192.168.254.47]) by imap.suse.de (Postfix) with ESMTP id 55DBC11A98; Wed, 9 Jun 2021 11:39:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1623238774; 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=tbfCejBm4aJ4eyiGJzBDybVMR3HougtHgUCP1fs72bo=; b=abQ+3zq7aibBT/g90YxFKE7rlf+NZ9S9FZTxwKAh2QuzmHAYSsa8uB5EK/eiHpxrHVrPxq pgjW2LElsW0P+47Y+kCK7ikqyJsPBOZvoJKHKcxqiVqsGrH2Qoat0SQPh+TJAnsFRSyH+B AjgejlpHfvZzB4AoT7DbzQM4CynrS/I= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1623238774; 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=tbfCejBm4aJ4eyiGJzBDybVMR3HougtHgUCP1fs72bo=; b=bqh+vEXLGfW4VC1I3METAhg3INHSZVUllLrlgqb3HKqRkpcukg/2P3UhNoA4Ky7WoOrqok A7E8UUQ37dmjHKBA== Received: from director2.suse.de ([192.168.254.72]) by imap3-int with ESMTPSA id QLR+FHaowGD6XgAALh3uQQ (envelope-from ); Wed, 09 Jun 2021 11:39:34 +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 15/34] mm, slub: restore irqs around calling new_slab() Date: Wed, 9 Jun 2021 13:38:44 +0200 Message-Id: <20210609113903.1421-16-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 allocate_slab() currently re-enables irqs before calling to the page allocator. It depends on gfpflags_allow_blocking() to determine if it's safe to do so. Now we can instead simply restore irq before calling it through new_slab(). The other caller early_kmem_cache_node_alloc() is unaffected by this. Signed-off-by: Vlastimil Babka --- mm/slub.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/mm/slub.c b/mm/slub.c index acb5e8f1d9da..f4ce372e3dd3 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -1749,9 +1749,6 @@ static struct page *allocate_slab(struct kmem_cache *s, gfp_t flags, int node) flags &= gfp_allowed_mask; - if (gfpflags_allow_blocking(flags)) - local_irq_enable(); - flags |= s->allocflags; /* @@ -1810,8 +1807,6 @@ static struct page *allocate_slab(struct kmem_cache *s, gfp_t flags, int node) page->frozen = 1; out: - if (gfpflags_allow_blocking(flags)) - local_irq_disable(); if (!page) return NULL; @@ -2739,16 +2734,17 @@ static void *___slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node, goto check_new_page; } + local_irq_restore(flags); put_cpu_ptr(s->cpu_slab); page = new_slab(s, gfpflags, node); c = get_cpu_ptr(s->cpu_slab); if (unlikely(!page)) { - local_irq_restore(flags); slab_out_of_memory(s, gfpflags, node); return NULL; } + local_irq_save(flags); if (c->page) flush_slab(s, c); -- 2.31.1