Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1043923pxb; Tue, 17 Aug 2021 02:21:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz2Rms673NnZ0ukduRO7CjVpInZqojb4hIKKBdTX2DutaiCoqky45Df1vnO90uO7JFODKL7 X-Received: by 2002:a6b:fd05:: with SMTP id c5mr2124521ioi.102.1629192101508; Tue, 17 Aug 2021 02:21:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629192101; cv=none; d=google.com; s=arc-20160816; b=dKRZB6FuIAlozo2mWcZiKuZjhjz/uBl2y27at49aPeGbsgGSa2n39bhRlMZYzOEkn5 OBO+JNj6vXptopGVqddPnDWGGi1KW6GYnoUPbHHUyysa0n5C5DCDdLBO4o3pstTFsiBU wwz3JgKT7Gq1LkxkzR71tPRGt13AHacuILdZwO5hXHZN/Ps5MArZ1DWaAJaf29MeeTCQ OCGvABvxu/QzvgSgXKolwkWQEJNeq437qzub6MqxZBjZZCcIN5V40BYafSvx5TRmQ/bX 6iZh34UvUlK40P+tYD+y0xUl6ounvBbQe2W/SwwVzIE9AIGJLFdbY4F/QRjdn1TqREDH TJkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature:dkim-signature; bh=FcHJOHB9hxwBX95Lq5+fSvyv0D1B8TQkgzP6Tk5EsGg=; b=P9wUNpJhJoPhgpZ6TK7znJAYlKP+oKov5YOzM0djHAEsWzetSIVDnopgN+iVyYLRNF YTvTGZ/k8v3gpkdaoXGtAnERwhOFqXmWJ93oPyl1EJu7rNlm3pOpHflUKwnCnENoMjJZ /AuQJXJuwX7IwC6d6WDSL6T3A8+nbBTsKGxMVul3FSXc7ozxQN5H158/oGkMHcauU72b Qv+ieNVwTlQ1lvMyo6CvhQ4Xi32yW58E0f3+y8iUL3mmZ14hDzY4zWXiC08WK7M/QUAL lx9vZMHyekb3yO2sy6EWwSBB2gTLGzEoN3baXebcfGVjT25hSA0GZ3kiIptyiKvzA91P ufTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=Q1Ue4lmU; 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 q23si1939363jav.118.2021.08.17.02.21.30; Tue, 17 Aug 2021 02:21:41 -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=Q1Ue4lmU; 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 S234347AbhHQJUH (ORCPT + 99 others); Tue, 17 Aug 2021 05:20:07 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:33590 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239706AbhHQJSb (ORCPT ); Tue, 17 Aug 2021 05:18:31 -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 9FD8D21AC4; Tue, 17 Aug 2021 09:17:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1629191877; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FcHJOHB9hxwBX95Lq5+fSvyv0D1B8TQkgzP6Tk5EsGg=; b=Q1Ue4lmU8mSpZvw1jtNZcNdEjWJ6LtxZEWl1Yuas6TTDZltMyaivB+tgvo/T6NxxAt1ZAP K4k08RVwAVpU87Z1J1lAQsmeVXF1UZ2si4CvF0JZS0U1nQW/EPxORvzKlOWQzZhHe8uKwq tOcR3TKjclfz/LV/HYh2dqHx0ek5ebU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1629191877; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FcHJOHB9hxwBX95Lq5+fSvyv0D1B8TQkgzP6Tk5EsGg=; b=fmKxYivOY6uxbdXwnLHlF4/urCoLuB7rk5gMhM5bW0KV2l/PByOYtmeqe8r8iKvM5JzJel N8WtNzm39EQIyeAw== 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 C11FE13D26; Tue, 17 Aug 2021 09:17:56 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 5PsCLcR+G2FFTwAAMHmgww (envelope-from ); Tue, 17 Aug 2021 09:17:56 +0000 Subject: Re: [PATCH v4 35/35] mm, slub: convert kmem_cpu_slab protection to local_lock To: Sebastian Andrzej Siewior Cc: Sven Eckelmann , akpm@linux-foundation.org, brouer@redhat.com, cl@linux.com, efault@gmx.de, iamjoonsoo.kim@lge.com, jannh@google.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, mgorman@techsingularity.net, penberg@kernel.org, rientjes@google.com, tglx@linutronix.de, Stephen Rothwell , Peter Zijlstra References: <2666777.vCjUEy5FO1@sven-desktop> <7329198a-2a4e-ebc2-abf8-f7f38f00d5e1@suse.cz> <20210817091224.nqnrro34cyb67chj@linutronix.de> From: Vlastimil Babka Message-ID: Date: Tue, 17 Aug 2021 11:17:18 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: <20210817091224.nqnrro34cyb67chj@linutronix.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/17/21 11:12 AM, Sebastian Andrzej Siewior wrote: > On 2021-08-17 10:37:48 [+0200], Vlastimil Babka wrote: >> OK reproduced. Thanks, will investigate. > > With the local_lock at the top, the needed alignment gets broken for dbl > cmpxchg. On RT it was working ;) I'd rather have page and partial in the same cacheline as well, is it ok to just move the lock as last and not care about whether it straddles cachelines or not? (with CONFIG_SLUB_CPU_PARTIAL it will naturally start with the next cacheline). > diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h > index b5bcac29b979c..cd14aa1f9bc3c 100644 > --- a/include/linux/slub_def.h > +++ b/include/linux/slub_def.h > @@ -42,9 +42,9 @@ enum stat_item { > NR_SLUB_STAT_ITEMS }; > > struct kmem_cache_cpu { > - local_lock_t lock; /* Protects the fields below except stat */ > void **freelist; /* Pointer to next available object */ > unsigned long tid; /* Globally unique transaction id */ > + local_lock_t lock; /* Protects the fields below except stat */ > struct page *page; /* The slab from which we are allocating */ > #ifdef CONFIG_SLUB_CPU_PARTIAL > struct page *partial; /* Partially allocated frozen slabs */ > > Sebastian >