Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp6094953pxv; Thu, 29 Jul 2021 06:25:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwDMjELrJ1xGXHQd6p58vznjZIMepH16Q/yD13GVjk7IG5drYkhd1JE+awlPwE4/3E9ygLN X-Received: by 2002:a92:d3d2:: with SMTP id c18mr3686963ilh.192.1627565120222; Thu, 29 Jul 2021 06:25:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627565120; cv=none; d=google.com; s=arc-20160816; b=XUev+BPGCq9FfylTWkiRjP3OFCog89A6qtkntoGfdQVoBZ6H3zt0zYx01WZxJPcI1b JiLZnJkmEI+rXPh6BO0Szm8nvEIH1EBJm4MMPC9YpFz0S8oIMnJQ6QLdE5GjxfdCz4PU lWHqoGZnDLhBR2mFXTmcZyIxREHzoaaoIVQfH9X1flPDpEYTzKJHVpuRes4/rt8QedoH RHqaRKuDiDkkhjMLiU7ZxCBniQOTELWMENvFHLubFR1ZMquAwQ+FMsRoppXjyjrH6tfj YZXYZrgDLGzYhwY7GouGWKN0b6xHfYf+AeNUzBPa+gY4zbfcV8G4iWXw8Z4g6W8FPYEe CryQ== 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=Spnm0O6n64qhlr2XGPvA2PUtVAcdwbpZIioj6ZLdH58=; b=RaX8wrPY4nFwDeBgnyG33QvnRJGSZvMLhITX1iGTramdTgw891DpDbgzjuIMQNrygI IxqcCUR8mAFPvSVN3o5PClwtF6BF0zGS6Q/y47IFMerr40Batp9F/hASnUZYQ7AIkXeV Of/H9uMU7gGLj06k+dSo6C5XF0hGVOlQ0/Cx75AmLHIfz0Kjin/V922mSYyIT70M79r+ iaQVkNS/dXqDfsxuw1MzrobNWYGsYLn3PciafdBrfe4pUTIY/40T2DlZ0809UvaC9ttd Ti9wF7ptma0DIjzEcydYZ2PIuHynpKI3cZbhJKV+tKM6K7xFqdDBxKBxO1p4ItInBqax cFXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=FhpC21ru; 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 q23si3658148jav.118.2021.07.29.06.25.09; Thu, 29 Jul 2021 06:25:20 -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=FhpC21ru; 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 S237557AbhG2NXz (ORCPT + 99 others); Thu, 29 Jul 2021 09:23:55 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:38450 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237558AbhG2NVu (ORCPT ); Thu, 29 Jul 2021 09:21:50 -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 17961223E4; Thu, 29 Jul 2021 13:21:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1627564906; 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=Spnm0O6n64qhlr2XGPvA2PUtVAcdwbpZIioj6ZLdH58=; b=FhpC21ruGcT/IIFipPswb67TUkBPRFQKtDqt+2V1cqXwJHfTIsA0PAJdbjMTaHvp5xEwhO aY6EzGwLIVLmbfaocrGWjx5dq+iD9i1JqmoYuGLa1rI2GCzXM/YR0lPcEt0jug0wMy4dUJ YLzKT0YymdBo9KxBaZuq3W6axxP4X0g= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1627564906; 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=Spnm0O6n64qhlr2XGPvA2PUtVAcdwbpZIioj6ZLdH58=; b=+mZHWZCfs53I6rkudWs7kJsjE+ppto48K/GH4/OLzxwP9fpW+fkVHE4oQBRFslcreip6cR CEswKUxpUc2uC0DQ== 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 DA0CB13AE9; 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 qOWmNGmrAmF9AwAAMHmgww (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 30/35] mm: slub: Make object_map_lock a raw_spinlock_t Date: Thu, 29 Jul 2021 15:21:27 +0200 Message-Id: <20210729132132.19691-31-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 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 dbb74dbe1c1e..1ee3ef7a1d3b 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