Received: by 2002:a05:7412:8d1c:b0:fa:4c10:6cad with SMTP id bj28csp693648rdb; Wed, 17 Jan 2024 14:44:22 -0800 (PST) X-Google-Smtp-Source: AGHT+IHe6xgNpGIwiXcb4WhrMweEeTQuHtvyWntKJmdc7zJ8VUd1TmTyK8fx6Jyv6f4sprN6BgD1 X-Received: by 2002:a05:620a:269e:b0:783:6a5c:2e05 with SMTP id c30-20020a05620a269e00b007836a5c2e05mr3610157qkp.106.1705531462209; Wed, 17 Jan 2024 14:44:22 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705531462; cv=pass; d=google.com; s=arc-20160816; b=DQpHc41Wze3xx1VNKKtkGe3HMql2lOGOKXJL/Q/Mn/095Fq5k4X8UbOnHqBX3tXM2g xHzmYWOc22dNoxfHkbfxuAhgcAgeNcJH9dld2FZuINr2HAuydyJF5neZviNcg5XkVe5T cg2yauiP2CvY8G8/28iAVZ57zwfH59kGSfZNGRSytMolpSx+CMW/y3B/ezzk0PO/wg7f XpDZFKsrQSTrl4rx12dytGfiJnUwkzmZvoDPR4DTEwODzXbri4UWblp91foaCG5PIyjs 34w9sIgVBD0XWIgBzR/FF+Ekd6MByFtYMa+GR6abrXkPldZJDHhroXFZ5tke0IrrogHX ZCzA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:in-reply-to:subject:cc:to:from:date; bh=SG9poUcxB3t4puUoU3dRcr7W1u7M2+ATxA7paKfqKRc=; fh=wTIETHJ2c1QBGcIcGaqUVnHGV1uJo9JrQsjLEZZMYdQ=; b=SJH4+vpezoW1jpGOmEc6FtoAk43HItNgNvrTxcmgjTGC2VwmiuouX6BnFJUzGkSmJd 5iWoozQSK/WuuZveankMjE5UsMBzn/SKt+QRNr+/LNGjUMdlZ+kaJp6TGGkQa+iEzR28 EVmhccVYHjdEXE6VTt1SiCVvL+Kr2AH31qJeP34Z4cLPnB9boMz8gZTRbNpcDwaOZ5qJ oD5F5+F7y0SN9jr7tujnwvCKTOy97UaWxEFJFQdw1bX/ddV78meivEzHEQqJ3aAVOvvV K7qGWaX783IU6WiJoKrrEZwX1P4LaNinAEdqU+GBTmHq9Ttg/O+dIF8lXEkA45vHPl1b 64lw== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=gentwo.org dmarc=pass fromdomain=gentwo.org); spf=pass (google.com: domain of linux-kernel+bounces-29509-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-29509-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gentwo.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id u22-20020a05620a431600b0078307a2f9bcsi13251022qko.15.2024.01.17.14.44.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jan 2024 14:44:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-29509-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=gentwo.org dmarc=pass fromdomain=gentwo.org); spf=pass (google.com: domain of linux-kernel+bounces-29509-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-29509-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gentwo.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id F1E6C1C221E6 for ; Wed, 17 Jan 2024 22:44:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A2935288DF; Wed, 17 Jan 2024 22:41:15 +0000 (UTC) Received: from gentwo.org (gentwo.org [62.72.0.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DB424288CF for ; Wed, 17 Jan 2024 22:41:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.72.0.81 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705531275; cv=none; b=JkkrOCVWXwoB3HxrDNdFyIqZLYRewxN8c7G6sTYnzPplHUypFI2me0pJXJlKyKmtnhEbpWOz/Te6PWvrD5JIUj4TjhRjzYDsVS9YCvlr6D7mM6WdXhtOufxR4wY8exfWddK8qliDkl9pzGK5E9to9CzUyVzmWtS0vghTpt+ZspY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705531275; c=relaxed/simple; bh=tLO73DrRLHxpNwP+tcdGTJ/LqLrt/oVJwNsNMB12t7s=; h=Received:Received:Date:From:To:cc:Subject:In-Reply-To:Message-ID: References:MIME-Version:Content-Type; b=YomvWGdPjW7LOjB9KbnnqIpsqN+K5jn+CdGkngR+JDrk+RFDyrQWN1adX4UXRFCpsfHd3qU6c2a+VXa03Hn1/xzx4U/d2LdlK/oe5h1znaSdVzkCWwny0cZ8qosDI1jfax5v/Mlnk4Q/jwyiiOv9aeNe7HW83ik/TnZ48wmWTyM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gentwo.org; spf=pass smtp.mailfrom=gentwo.org; arc=none smtp.client-ip=62.72.0.81 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gentwo.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gentwo.org Received: by gentwo.org (Postfix, from userid 1003) id 2BE3740A8B; Wed, 17 Jan 2024 14:41:13 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by gentwo.org (Postfix) with ESMTP id 2A50E40A85; Wed, 17 Jan 2024 14:41:13 -0800 (PST) Date: Wed, 17 Jan 2024 14:41:13 -0800 (PST) From: "Christoph Lameter (Ampere)" To: Chengming Zhou cc: Hyeonggon Yoo <42.hyeyoo@gmail.com>, Joonsoo Kim , Vlastimil Babka , Pekka Enberg , Andrew Morton , Roman Gushchin , David Rientjes , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/3] mm/slub: directly load freelist from cpu partial slab in the likely case In-Reply-To: <20240117-slab-misc-v1-1-fd1c49ccbe70@bytedance.com> Message-ID: <76641777-1918-2b29-b6aa-bda9b5467aa3@gentwo.org> References: <20240117-slab-misc-v1-0-fd1c49ccbe70@bytedance.com> <20240117-slab-misc-v1-1-fd1c49ccbe70@bytedance.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset=US-ASCII On Wed, 17 Jan 2024, Chengming Zhou wrote: > The likely case is that we get a usable slab from the cpu partial list, > we can directly load freelist from it and return back, instead of going > the other way that need more work, like reenable interrupt and recheck. Ok I see that it could be useful to avoid the unlock_irq/lock_irq sequence in the partial cpu handling. > But we need to remove the "VM_BUG_ON(!new.frozen)" in get_freelist() > for reusing it, since cpu partial slab is not frozen. It seems > acceptable since it's only for debug purpose. This is test for verification that the newly acquired slab is actually in frozen status. If that test is no longer necessary then this is a bug that may need to be fixed independently. Maybe this test is now required to be different depending on where the partial slab originated from? Check only necessary when taken from the per node partials? > There is some small performance improvement too, which shows by: > perf bench sched messaging -g 5 -t -l 100000 > > mm-stable slub-optimize > Total time 7.473 7.209 Hmm... Good avoiding the lock/relock sequence helps.