Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp652855pxt; Thu, 5 Aug 2021 08:28:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwqWi1ovTrxD7jqgg1gJ4wVk0s55M3pvthwzC+lGiYIQbWk6vpcrLIJIkimSE3JKzQnTCF/ X-Received: by 2002:a50:9350:: with SMTP id n16mr7226832eda.176.1628177307719; Thu, 05 Aug 2021 08:28:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628177307; cv=none; d=google.com; s=arc-20160816; b=RI7HteKuS/euQhcFXvAYSYvYJ8WincYZi+9rAnV2C2XzehfvulTwCqfzfBN81gfIdH R+Yc0EtQ+uFr4/H9rp88LeP1HcmxPgPmJXWoDvzzeFa3ievHvrWrWjm9RPBc0g+WXQLi 1Oz153OaNZNZdSGnOsbAn5/G+ViJoxGk+Lw9Gh4KNa9d4f7XQx79sMFxUoYictvny/Cn 8rISn7s/UoP0qYdBtGvlo0z6/6IYyKERO1vjCLs0TQ1YIDv6Uhw60/psL/rmJZj9COSx O0eYeKv0inBziwbykfxd+lC4tk6sCi9hKFo2j2SxJ0AR8VXWab8LBBr+FRSAmL+5tshi y/dw== 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=6FuCguIw3y1xLD9yHceZ5J55RGlWV/2iWhn/MaGBC+0=; b=DxffnQGV1e8GdKBuMNvvD1RP3DGcJGGf/Y/eBAnZyTa1yVWSs5vXIcuQ4NTYpYM99U eZlaMtVfkaEte3TqprVl91go9T7ZxunJHcP/y1FHJ3xYh82pTPUL4YE82c8aNV/8roZd 3kzw52D84gZ65RSiBSkBmnj6ByUhmK+A36CzzfsAtTW4Eq+1qubWpJXanwodI7+dm6wL EUV2dNcRO29RnJ3FKDiYJsQ+/Stfv2maLoehyyGKW1U2bSBRjvJbwt7v1GQae3IXCB95 PT7gsDVn8FLYDw0y9iKNVf4qCgUezLlFHUQIqWyTmzEnZwhKL2Rc5MWVnHjmQNwCxZIR l7+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=bDrdzJtq; dkim=neutral (no key) header.i=@suse.cz header.b="hk4BD/Au"; 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 c5si6212729edf.259.2021.08.05.08.28.04; Thu, 05 Aug 2021 08:28:27 -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=bDrdzJtq; dkim=neutral (no key) header.i=@suse.cz header.b="hk4BD/Au"; 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 S242353AbhHEPZp (ORCPT + 99 others); Thu, 5 Aug 2021 11:25:45 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:59256 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242000AbhHEPUY (ORCPT ); Thu, 5 Aug 2021 11:20:24 -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-out2.suse.de (Postfix) with ESMTPS id C589C1FE6C; Thu, 5 Aug 2021 15:20:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1628176809; 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=6FuCguIw3y1xLD9yHceZ5J55RGlWV/2iWhn/MaGBC+0=; b=bDrdzJtqn2NeXguHYpQPeyawckT9NFqHEqsUTafXcYCtQnISdN/R7E8ptmff1GxKbrOTzu aUugOzNmtjBKoMiVgsvdiPs+skCxQDTqLKW2nZakJ0fv50tkL3ghsB20AQlJ/L4UexWO9g 2+RjMTEkN28tAsrn+F1JhVwtASaMR7M= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1628176809; 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=6FuCguIw3y1xLD9yHceZ5J55RGlWV/2iWhn/MaGBC+0=; b=hk4BD/AuvOtCAaHSpbeeXav7yciHJ+gdfePS7DN6T76pCPGCKkbXBT7zb0rxqoW3r7IHFv DhDnLMme7ezSF8Cg== 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 997B113DA8; Thu, 5 Aug 2021 15:20:09 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id qCjnJKkBDGFDdQAAMHmgww (envelope-from ); Thu, 05 Aug 2021 15:20:09 +0000 From: Vlastimil Babka To: Andrew Morton , Christoph Lameter , David Rientjes , Pekka Enberg , Joonsoo Kim Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Mike Galbraith , Sebastian Andrzej Siewior , Thomas Gleixner , Mel Gorman , Jesper Dangaard Brouer , Jann Horn , Vlastimil Babka Subject: [PATCH v4 30/35] mm: slub: Make object_map_lock a raw_spinlock_t Date: Thu, 5 Aug 2021 17:19:55 +0200 Message-Id: <20210805152000.12817-31-vbabka@suse.cz> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210805152000.12817-1-vbabka@suse.cz> References: <20210805152000.12817-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 da48ada3d17f..9cb58d884c58 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -438,7 +438,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) @@ -483,7 +483,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); @@ -493,7 +493,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.32.0