From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 55983C433F5 for ; Fri, 1 Oct 2021 00:39:16 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D9160610E6 for ; Fri, 1 Oct 2021 00:39:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org D9160610E6 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 51D7F9400EC; Thu, 30 Sep 2021 20:39:15 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4CEE09400E4; Thu, 30 Sep 2021 20:39:15 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 36DCD9400EC; Thu, 30 Sep 2021 20:39:15 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0185.hostedemail.com [216.40.44.185]) by kanga.kvack.org (Postfix) with ESMTP id 25C6D9400E4 for ; Thu, 30 Sep 2021 20:39:15 -0400 (EDT) Received: from smtpin12.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id CC5943A8D8 for ; Fri, 1 Oct 2021 00:39:14 +0000 (UTC) X-FDA: 78646009428.12.DD44CC9 Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) by imf29.hostedemail.com (Postfix) with ESMTP id 829B29001A8E for ; Fri, 1 Oct 2021 00:39:14 +0000 (UTC) Received: by mail-pl1-f178.google.com with SMTP id bb10so5215622plb.2 for ; Thu, 30 Sep 2021 17:39:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=fsgJJe7WOlN9DnqJOauj+mZ3ubzgkIojJ6QkyDZqouc=; b=l4bCcl1a47UkkzW3mbzukb0KurVpGgxKyI/V3Ofv3BRDeQst1xcWBeAG1fna/I6scx 04PKT+MF6l6uj+4y5ZVugrNcoxECLKMBCq018wofS4HqoYth25pcdGT6P3+8SJzk+3Xx T1v3CIugj0yUuNFXjkdfGR4sTT/44lerOnQPqsTUScDS7C7MNHZUfD2wakAYMOSnZxwd Sp4k/tuUSz6Sz0E9h5j0/JGbe5H3W8Yi41TDXlMzelZjLeOhWGP24XcPvpAyuE7G67FA 9yX/IsZtE+5YF/6oI5oimOWcT22u7Ax51JCPqC4xaxVVYlcgXEOM3nBQW+w4Qhis40Zp 8kLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=fsgJJe7WOlN9DnqJOauj+mZ3ubzgkIojJ6QkyDZqouc=; b=0+3VvWSXdt6F3X1ms83BI3PSMmbqhX+qRO5vDiB+clyUCl8TuPGi1vQ/s0s/Bn4lX4 n9VeNNVLSYWlreVMAA5TUQBBP+eipE9AVtEOhgBTWVfvmSiqYz6hWB20eF627QQ1DP8J QhOaQ3rYttRMkRGvjXzi+lBV7KKKQ52EZOIcotAVDZxr6VjWajzD0IIutDqYPi+KcNys b5dZyX6w6K5IHo5XUcTmyW3TOe/nbM2bkLnRp9sLFKA+Hy068fimxr85GkO81VGZcvyI gWnT0WpsDJXBmw7GMeaXIUimiilV+KqQ2CS/xu/aCaYLJrvKkv2wX1p3eT6a85Ksai2J B2YQ== X-Gm-Message-State: AOAM531nQUjdBxV52KjJABUp6NsuOsJtgX8T1McJd9Tww4fV7QVqeD/e fMthlZT04eawOKdc7XwoY7g= X-Google-Smtp-Source: ABdhPJxnjbIxtoCXYeWXBoNfyR9DqjYl+OzpSV/+oYdqMHZqVprHVFXyIX42fASFR1Rs5QW237r/fw== X-Received: by 2002:a17:90a:88c:: with SMTP id v12mr9905694pjc.232.1633048753379; Thu, 30 Sep 2021 17:39:13 -0700 (PDT) Received: from linux.asia-northeast3-a.c.our-ratio-313919.internal (252.229.64.34.bc.googleusercontent.com. [34.64.229.252]) by smtp.gmail.com with ESMTPSA id r13sm4013111pgl.90.2021.09.30.17.39.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Sep 2021 17:39:13 -0700 (PDT) Date: Fri, 1 Oct 2021 00:39:08 +0000 From: Hyeonggon Yoo <42.hyeyoo@gmail.com> To: Vlastimil Babka Cc: linux-mm@kvack.org, Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , linux-kernel@vger.kernel.org Subject: Queueing is outside of SLUB nowdays Message-ID: <20211001003908.GA2657@linux.asia-northeast3-a.c.our-ratio-313919.internal> References: <20210927090347.GA2533@linux.asia-northeast3-a.c.our-ratio-313919.internal> <8aa15f4b-71de-5283-5ebc-d8d1a323473d@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8aa15f4b-71de-5283-5ebc-d8d1a323473d@suse.cz> X-Rspamd-Queue-Id: 829B29001A8E X-Stat-Signature: hz3uztn6yug7kbxj6xgf5b8czf1qcssu Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=l4bCcl1a; spf=pass (imf29.hostedemail.com: domain of 42.hyeyoo@gmail.com designates 209.85.214.178 as permitted sender) smtp.mailfrom=42.hyeyoo@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Rspamd-Server: rspam06 X-HE-Tag: 1633048754-235020 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, Sep 27, 2021 at 07:03:19PM +0200, Vlastimil Babka wrote: > On 9/27/21 11:03, Hyeonggon Yoo wrote: > > Hello there, > > > > I've been working on adding 'lockless cache' on sl[au]b for a while. > > But what it actually does is actually adding 'queuing' on slub. > > Yeah, I pointed out those threads from 2011 that called it exactly that... > was there any conclusion why that was not ultimately merged? Looking at other layers, they implemented queuing layer outside of SLUB. See commit 795bb1c00dd ("net: bulk free infrastructure for NAPI context, use napi_consume_skb") for example. They made skb cache because SLUB is not suitable for intensive alloc/free. And because the queue is outside of slab, it can go lockless depending on it's context. (But it's not easy to do so in slab because slab is general purpose allocator.) So current approach on place where slab's performance is critical is implementing queuing layer on top of slab. Then new question arising: - Is that proper way to solve fundamental problem? - why not use SLAB if they need queuing? - how does this approach work on SLAB? - If there are no problems with queuing outside of slab, why does SLAB exist? can we just drop SLAB? I think we need to think about questions above.