Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp1225276pxb; Sat, 4 Sep 2021 04:00:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwDmE7txrdc461Vjr7b1aHy0+h0aSTVhGjLOlgVliyisYC0ejLd3J2C3lzxuDOGDG7JPx43 X-Received: by 2002:a17:906:b1d5:: with SMTP id bv21mr3653499ejb.346.1630753225707; Sat, 04 Sep 2021 04:00:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630753225; cv=none; d=google.com; s=arc-20160816; b=fe8rdViL0O3LpH4foKi1WzNaUdNERm9JeB3UPgXdO2U3hK8jzwNyo7kfA7Ox/yH8Lc UfYPPPwQ7riTrJwd0GS+QmUqZ/lBqH4ayEbbrhNabKe5U3vL5rwanLP2eM/K1c8qcgRw lSusXY8niKcUgSTgnksME7RxaVvMKka7FJo2ua2pBAXbTeP2eIBNy9L5KvFVDY3CzAVU DXQircpLFpgYv9elMC1ekbbxhTEPW10XC1wzbGdHgGsH0Sl3rz5PKQlDkJ84y6UGIdKZ UfHSkaGA6KPuQihXHY7WZ/DFLMYVmNjAazDp4ig2CAwckx9wOwd3MPRtLAsu7LZsMPk7 7r5w== 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=Ime3x2lj2MOgr3oHMSc5CXs9wlGouwatOfwI8ckMnLg=; b=hPjd7L/jxEyZfgE34HTYJoNkbREdoBNB8Mvs4nah+jh6rO3qxkpjtyxgxtTnCNKTbf v9+F2JdTLA29qxhHJSqH0QIBCttw2MhWRx6TMa8lx25WpmgT/RypVse0UMZTYW1rWqcE Aq4piiWbqKYgw5OLjFJIqT/XUxSpN5ySTnr74SJn0OvldwqNCyS+F1O++2nrxLryghKT i5zjAYrose8zQ60SdknFTJB58mC65v2RwRfMdZWjpQcof/Bz9Bm6MRrDV/9Bq9fiucYC C249xoAYhN/ttdSPzrVHdQ+k8XYLKKlrLvpqwbck5kAq6kY0ga1XlObGMvY0dJNUK/NX BTCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b="l/h5S0Tz"; 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 nd19si2112705ejc.48.2021.09.04.04.00.02; Sat, 04 Sep 2021 04:00:25 -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="l/h5S0Tz"; 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 S1351390AbhIDKxA (ORCPT + 99 others); Sat, 4 Sep 2021 06:53:00 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:59828 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351154AbhIDKvQ (ORCPT ); Sat, 4 Sep 2021 06:51:16 -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 73405226A3; Sat, 4 Sep 2021 10:50:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1630752614; 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=Ime3x2lj2MOgr3oHMSc5CXs9wlGouwatOfwI8ckMnLg=; b=l/h5S0Tzw82raud2Cto9UcG5h9t8KUOWUD2lDa2rL8Ty1Xa+g/EM6ZuP0aWDg85v4v+ryP DnzuxAw1XJuC+obJOOdhRw2wh/4HaiBaLsEpUd0WWUuO+O7w1XIxzkOpzDPztByFOGx9QY 9hlWc97cTKR7ufc9X+T3WtOXzEwlMt4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1630752614; 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=Ime3x2lj2MOgr3oHMSc5CXs9wlGouwatOfwI8ckMnLg=; b=Y4fw0QTUZvGWMJNVmAxwsoRtl6qze+L6rdP/4a0hRauvr3LaE/9+ICKGwjgtQsWEsq2bzy EjhtxASnhczYEyCw== 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 4B0D413A2C; Sat, 4 Sep 2021 10:50:14 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id SHu8EWZPM2HoUQAAMHmgww (envelope-from ); Sat, 04 Sep 2021 10:50:14 +0000 From: Vlastimil Babka To: linux-mm@kvack.org, Christoph Lameter , David Rientjes , Pekka Enberg , Joonsoo Kim Cc: Andrew Morton , linux-kernel@vger.kernel.org, Mike Galbraith , Sebastian Andrzej Siewior , Thomas Gleixner , Mel Gorman , Vlastimil Babka Subject: [PATCH v6 29/33] mm: slub: make object_map_lock a raw_spinlock_t Date: Sat, 4 Sep 2021 12:49:59 +0200 Message-Id: <20210904105003.11688-30-vbabka@suse.cz> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210904105003.11688-1-vbabka@suse.cz> References: <20210904105003.11688-1-vbabka@suse.cz> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1480; i=vbabka@suse.cz; h=from:subject; bh=2/8u3UH5En3AyznTWqpc4cL+b7AuqqKzQa93bRzqE7A=; b=owEBbQGS/pANAwAIAeAhynPxiakQAcsmYgBhM09Pf1VeinWtUFeSCTnH3nZhlj6Wr8HzOQ3KMWZ7 xmNb/bKJATMEAAEIAB0WIQSNS5MBqTXjGL5IXszgIcpz8YmpEAUCYTNPTwAKCRDgIcpz8YmpEPKfB/ 0TnPZL0UUrCRyKA60dWdmDV6d2u+fC/GWjzEF8xEjTExfmEVDS1nERDrZm+2LZLm6wcf7J5xAwr85/ F+KdZk7ratV3QSOQEGIbCa4umGO+Mt3C7bTuRe6Y755IzvcBq/IE5/UlzNZ1XXGp/iotTjEWkXoM/S Lcs6DbyK6mlRiPVKKHFXEGLQA10yJ347Sry1av6y8RektgBUBSvUL0conZ39EwzvkpieZG5NUs7bHq NET+bNFKes768IP7uri2+kMK8076o9EwZLV9L4EabGdJSHF40kqv73BXWgOpF8U79dpOLo5ALBjRD/ Pw3rL18n3jmAsJk8ARATI9xzMhNc/K X-Developer-Key: i=vbabka@suse.cz; a=openpgp; fpr=A940D434992C2E8E99103D50224FA7E7CC82A664 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 b7f8b9d34e46..76e56ce55d21 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -452,7 +452,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) @@ -497,7 +497,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); @@ -507,7 +507,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.33.0