Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1051323pxb; Tue, 17 Aug 2021 02:34:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyjTQFAtJP0gMBQymWFOvIVWz0GVKBTBp46Q6L0LibSHWI72Ycp2d+qh9iInmNRF8ngCw2B X-Received: by 2002:a05:6638:408f:: with SMTP id m15mr2186322jam.126.1629192873394; Tue, 17 Aug 2021 02:34:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629192873; cv=none; d=google.com; s=arc-20160816; b=CeP/efdu2P3mz+MUVzmABWdx/JClN2Wbt7KDytqLvbPDRwLRTUVy83xYyX4NC8M6Z0 HdmF+YYlCJQ0NsoFnQjXfBUIH5z+L0lf1RYwYXDVlDiWD4YDcuSoDWtLmDjElhiBImTk AFzgTgVBwRStvcbaVmQmDVCi1h6dUoqqHQxLsJ86E9dflE0wtQQRwnvXloJme1l1/KAR bXN5oPrX6Uajz6E0ywy9uJzYTuHt85n2VujqJuQmoEnoJlAVdTvcX1PLq3hVozCVG4vn El9C37o48zlPPpzLfbIsMtYlf444gsjINxFSrUdxrXL/XDnonPVXIUtYKBIdaeyVtxWR uF2Q== 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=J27QbjsN89ukN+TPv/Yz4fAGneJrqaWAet+7YsBbiqQ=; b=rQJ38qiA6aeLtkvIJpkpig+dZnWahvwfGKHF6CxXxd5HjHilNIDcQNTg4QuNalFUow vGqxgBUuTF97pDVb3K3XeOyHp/ONqtSc6FhQ+eHF57TRBmeyxM0u1pmr96kGgHL2jtTw Ip0A03J2covGMi76CPXk5Pq/Dvta7Z8cxqKa8wlD+hLRdEsMTADh/3YcT1dArG8A7RqZ WKN/93xYPQWb+bhyEmt1GmBXMkGbfzj01Ragh565voLCYUIgJZjIMOzLUJ4+1lUnkGNx y2iHVwSs9Rjb8kPjrc+P30Vq7pOP9K/6mALQh/QpoFdLx2sFHEeL1sq4uBAH7jiNX6ok LICQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=1dRcIUB+; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=eWnYWRfy; 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 a5si2139051ioo.37.2021.08.17.02.34.21; Tue, 17 Aug 2021 02:34:33 -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=1dRcIUB+; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=eWnYWRfy; 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 S235521AbhHQJdM (ORCPT + 99 others); Tue, 17 Aug 2021 05:33:12 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:35534 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235418AbhHQJdK (ORCPT ); Tue, 17 Aug 2021 05:33:10 -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 5A10621DF7; Tue, 17 Aug 2021 09:32:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1629192756; 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=J27QbjsN89ukN+TPv/Yz4fAGneJrqaWAet+7YsBbiqQ=; b=1dRcIUB+LqODIrzX8P6kAvT7FXl8zWFVaINvGes9qvux3FmKE0P50q1kQ5Bglpghk3j0j2 sp6Y8e144ldHIOV++B7BsfLE5ZNBxNXEPOLPxyuB6xTkzBwTUkjIaYQPnjz8V4Zx0sM1FA wKGrSnvEvIQY0ODCrmaX407LI4A/ddk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1629192756; 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=J27QbjsN89ukN+TPv/Yz4fAGneJrqaWAet+7YsBbiqQ=; b=eWnYWRfyqexr3GcZQ+/fW4Q3l0L5iJCEAxHz+fTXU94OtlwObGwGQWGn9LxcePQf0Qz00D EtJbbp2QOnAsolDw== 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 7DDA313D26; Tue, 17 Aug 2021 09:32:35 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id l0yCGzOCG2HaUwAAMHmgww (envelope-from ); Tue, 17 Aug 2021 09:32:35 +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: <3da13f0a-2720-a38c-33a7-744668013390@suse.cz> Date: Tue, 17 Aug 2021 11:31:56 +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. Right. I wondered why the checks in __pcpu_double_call_return_bool didn't trigger. They are VM_BUG_ON() so they did trigger after enabling DEBUG_VM. > > 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 >