Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5155271pxj; Wed, 9 Jun 2021 10:21:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwVmjSTW1l6Qt6oRvPMKoFv+T2iz9jqiGxE+/VHkjAArqjRTzeqcH4+IFdwnHHjCk4jo5Ho X-Received: by 2002:a17:906:bfc8:: with SMTP id us8mr890487ejb.217.1623259311480; Wed, 09 Jun 2021 10:21:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623259311; cv=none; d=google.com; s=arc-20160816; b=LahFG3lQbjuktmwkPI1Cyrsdhg6SRYRA05Y59jwhVFhiFdhh86n7Q4Ck8MoYS+2zd8 ceeqBBCZcsujzI/LPMEk7zkZ7HSMiyYG6Hjd4o8WxS9pvbFak6n1zH09kAItNhpNkA1N 443+E1d87e382aloNcc9BhgHW3iX5SecHFdRziqLLJozh2JufEI2f60/s4PVrvDjYu5v nJ6bG+hDsYA2iorsSYNE0qn2ZUUDSqfZZVLEpqwKUwenBgPiiJmg6AUIMn+VCHdkdcCZ 7/w+Pum5ThsG7P6uQOQPnp9XBzmXbapsn9VtRfKRHYW91D8eg6Sewdsv2tbdhvdlripE tPKw== 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=2JMzciOjrM3f4PogJGc8S9HpllJu3Zah47/BJwa+Z4I=; b=tJJBR2tMbsuUiIaU+KfbwO6Vk7JkEN+BuothhdeoA+7L1PtEM4P7T6Y/h2k9tvYTkT a62vEw0St5CLXHZyCqHAvNKcXJmtvzzXqjELJBfUZsN8p6N2iPhsn1C9ZASItoSN/9ml sItC6I2TebeCb0zSaScrNYN6bli5jBcGPwpcvI6oIOkjSelcCaGRtPF588ByW7liZVwl LZ21T5kPHF0WGoN+lcVYXR7OgiMGbnvMLh+Qa91Rlu1qxTHSRi02qFa0wlB8M8ss7viY htzhWy9Nr8mqo1Pq62sL5b8VXaA1A5ASpFgFz0MsAofFJ97LozmQ0XUWT8skxEIdJlx3 Bg2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=HYimdiD0; dkim=neutral (no key) header.i=@suse.cz; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=HYimdiD0; 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 zh8si310591ejb.109.2021.06.09.10.21.27; Wed, 09 Jun 2021 10:21:51 -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=HYimdiD0; dkim=neutral (no key) header.i=@suse.cz; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=HYimdiD0; 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 S239331AbhFILnI (ORCPT + 99 others); Wed, 9 Jun 2021 07:43:08 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:54686 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239180AbhFILlc (ORCPT ); Wed, 9 Jun 2021 07:41:32 -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-out1.suse.de (Postfix) with ESMTPS id 8A313219EE; Wed, 9 Jun 2021 11:39:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1623238777; 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=2JMzciOjrM3f4PogJGc8S9HpllJu3Zah47/BJwa+Z4I=; b=HYimdiD0q/CIzWg6N9+ODMNUwd1vmK+xrYk38BNgyoP2eyp47gLB4RUh4/zYQD6PlFUxA5 LesyH/UW9lDttTY/jfpkBfcrWgskHewsYMPdpsNFOwWXZhmbK+9pBhc7JeD8meX6A5lLcA JSK8Xngjf3KQesVaKqF7iL7BWvNBKQ0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1623238777; 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=2JMzciOjrM3f4PogJGc8S9HpllJu3Zah47/BJwa+Z4I=; b=TikwQrejxZogM6sx8B9yhQLZFAqtzGFd6WvhKx8ugT1es4FCY/FZ93O8YnSXGrvUHti8CX 1DZ8SCb1IKNlXhCA== Received: from imap3-int (imap-alt.suse-dmz.suse.de [192.168.254.47]) by imap.suse.de (Postfix) with ESMTP id 5902A118DD; Wed, 9 Jun 2021 11:39:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1623238777; 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=2JMzciOjrM3f4PogJGc8S9HpllJu3Zah47/BJwa+Z4I=; b=HYimdiD0q/CIzWg6N9+ODMNUwd1vmK+xrYk38BNgyoP2eyp47gLB4RUh4/zYQD6PlFUxA5 LesyH/UW9lDttTY/jfpkBfcrWgskHewsYMPdpsNFOwWXZhmbK+9pBhc7JeD8meX6A5lLcA JSK8Xngjf3KQesVaKqF7iL7BWvNBKQ0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1623238777; 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=2JMzciOjrM3f4PogJGc8S9HpllJu3Zah47/BJwa+Z4I=; b=TikwQrejxZogM6sx8B9yhQLZFAqtzGFd6WvhKx8ugT1es4FCY/FZ93O8YnSXGrvUHti8CX 1DZ8SCb1IKNlXhCA== Received: from director2.suse.de ([192.168.254.72]) by imap3-int with ESMTPSA id 8GQ7FXmowGD6XgAALh3uQQ (envelope-from ); Wed, 09 Jun 2021 11:39:37 +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 30/34] mm: slub: Make object_map_lock a raw_spinlock_t Date: Wed, 9 Jun 2021 13:38:59 +0200 Message-Id: <20210609113903.1421-31-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 From: Sebastian Andrzej Siewior The variable object_map is protected by object_map_lock. The lock is always acquired in debug code and within already atomic context Make object_map_lock a raw_spinlock_t. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Vlastimil Babka --- mm/slub.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mm/slub.c b/mm/slub.c index 6e747e0d7dcd..cfd5a7660375 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -432,7 +432,7 @@ static inline bool cmpxchg_double_slab(struct kmem_cache *s, struct page *page, #ifdef CONFIG_SLUB_DEBUG static unsigned long object_map[BITS_TO_LONGS(MAX_OBJS_PER_PAGE)]; -static DEFINE_SPINLOCK(object_map_lock); +static DEFINE_RAW_SPINLOCK(object_map_lock); static void __fill_map(unsigned long *obj_map, struct kmem_cache *s, struct page *page) @@ -457,7 +457,7 @@ static unsigned long *get_map(struct kmem_cache *s, struct page *page) { VM_BUG_ON(!irqs_disabled()); - spin_lock(&object_map_lock); + raw_spin_lock(&object_map_lock); __fill_map(object_map, s, page); @@ -467,7 +467,7 @@ static unsigned long *get_map(struct kmem_cache *s, struct page *page) static void put_map(unsigned long *map) __releases(&object_map_lock) { VM_BUG_ON(map != object_map); - spin_unlock(&object_map_lock); + raw_spin_unlock(&object_map_lock); } static inline unsigned int size_from_object(struct kmem_cache *s) -- 2.31.1