Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp3839210pxb; Mon, 4 Oct 2021 10:42:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz46a/3zx77tSjw1ZLorZfjjQ9sD2Se7MQDHj0QwpIqgcw48J7cgq+x8QcvKGoa+/c9K7LI X-Received: by 2002:aa7:ccc1:: with SMTP id y1mr19879815edt.177.1633369349793; Mon, 04 Oct 2021 10:42:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633369349; cv=none; d=google.com; s=arc-20160816; b=Hfv2s48836E79Sfp2ZRyzxG61IJnP1w24hpan6GgUiCt4NkY/CBvbWjQ8odKoSAlaq N0RwnVzau5QOPqxZiohxceRGE0InBmCS1vCsTCoz2uv0e8r2M3m5BFeIinC0tO0ldwCQ GqoVJmMVhPVOG5MjBTiZ3CnlpamzPullxj6LnJJXWuHH2YaAoWXJBRvoUUOD7ObLNvjS eiR6nAc2mF+dpvIl7tb1TsRDLMYZpVyDfbyxAR2amDj3Lgdff5gXkBbZJ3XDP6kD+rhq smOf8SAAraknrk81b3e+8FUdHyor59XfUYCQcNHlcXQV6gIBFTSvlGbI0RUN7Pok37LI c6Wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date; bh=JyW9RZW1wliBA5q/3Pm6e8gxo+7/+fdKVR3t9MmiQ5Q=; b=1Koj3d0v6/HClOfdtghTdU/jNNdzwsuNT5qOYqBG9WXi10jIdsFrkVZ9S8LGeQWUlH fw7bd0ZDEl5clMfa57ypeRzLzhKXVqfMDpqBYFHbL/Uas2PgqQqB81zVR3kNzP4I7vsT 8BYJ+9o+gZASo30lM7+DNnuDwYb/RxIW6FxX4zq/+6m9PBEi9lh2OX5YYMiONqrImTU2 VVvw3PlaqwjwCbEt/7lIAvNlJGZgSeZgg6YRK/sXd7ak99xP67kOV8wxSgURxYSSe2qa zNgw7TEj0gvSFFBDKL5l5+8DO82sxDM8+7EeiTe287OlQd1Rtd37R4uWFmVoIWsEsY7E 3V3A== ARC-Authentication-Results: i=1; mx.google.com; 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 w14si23453772edd.343.2021.10.04.10.42.05; Mon, 04 Oct 2021 10:42:29 -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; 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 S235427AbhJDO61 (ORCPT + 99 others); Mon, 4 Oct 2021 10:58:27 -0400 Received: from vmi485042.contaboserver.net ([161.97.139.209]:57152 "EHLO gentwo.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234270AbhJDO60 (ORCPT ); Mon, 4 Oct 2021 10:58:26 -0400 Received: by gentwo.de (Postfix, from userid 1001) id E033CB00424; Mon, 4 Oct 2021 16:56:36 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by gentwo.de (Postfix) with ESMTP id DD8A4B00261; Mon, 4 Oct 2021 16:56:36 +0200 (CEST) Date: Mon, 4 Oct 2021 16:56:36 +0200 (CEST) From: Christoph Lameter To: Hyeonggon Yoo <42.hyeyoo@gmail.com> cc: Vlastimil Babka , linux-mm@kvack.org, Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , linux-kernel@vger.kernel.org Subject: Re: Queueing is outside of SLUB nowdays In-Reply-To: <20211001003908.GA2657@linux.asia-northeast3-a.c.our-ratio-313919.internal> Message-ID: References: <20210927090347.GA2533@linux.asia-northeast3-a.c.our-ratio-313919.internal> <8aa15f4b-71de-5283-5ebc-d8d1a323473d@suse.cz> <20211001003908.GA2657@linux.asia-northeast3-a.c.our-ratio-313919.internal> User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 1 Oct 2021, Hyeonggon Yoo wrote: > 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.) The queuing within in SLUB/SLAB is lockless. > So current approach on place where slab's performance is critical > is implementing queuing layer on top of slab. If you have to use object specific characteristics to optimize then yes you can optimize further. However, the slab allocators implement each their own form of queuing that is generic. > Then new question arising: > - Is that proper way to solve fundamental problem? There is a problem? > - why not use SLAB if they need queuing? SLAB is LIFO queuing whereas SLUB uses spatial considerations and queues within a page before going outside. Slab requires disabling interrupts, SLUB is optimized to rely on per cpu atomics and there are numerous other differences. > - how does this approach work on SLAB? SLAB has a lockless layer that is only requiring disabling interrupts. It provides a generic queuing layer as well. See my talk on Slab allocators awhile back. https://www.youtube.com/watch?v=h0VMLXavx30