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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id BF364C433EF for ; Tue, 30 Nov 2021 09:41:39 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0BC0B6B0073; Tue, 30 Nov 2021 04:41:29 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 06C4F6B0074; Tue, 30 Nov 2021 04:41:29 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E9CDB6B0075; Tue, 30 Nov 2021 04:41:28 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0121.hostedemail.com [216.40.44.121]) by kanga.kvack.org (Postfix) with ESMTP id DC0186B0073 for ; Tue, 30 Nov 2021 04:41:28 -0500 (EST) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 95EF58EC07 for ; Tue, 30 Nov 2021 09:41:18 +0000 (UTC) X-FDA: 78865103436.23.62A1CC0 Received: from gentwo.de (gentwo.de [161.97.139.209]) by imf29.hostedemail.com (Postfix) with ESMTP id 7F2239000257 for ; Tue, 30 Nov 2021 09:41:13 +0000 (UTC) Received: by gentwo.de (Postfix, from userid 1001) id 5A0B9B0034A; Tue, 30 Nov 2021 10:41:15 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by gentwo.de (Postfix) with ESMTP id 56157B00058; Tue, 30 Nov 2021 10:41:15 +0100 (CET) Date: Tue, 30 Nov 2021 10:41:15 +0100 (CET) From: Christoph Lameter X-X-Sender: cl@gentwo.de To: Rustam Kovhaev cc: David Laight , 'Vlastimil Babka' , "penberg@kernel.org" , "rientjes@google.com" , "iamjoonsoo.kim@lge.com" , "akpm@linux-foundation.org" , "corbet@lwn.net" , "djwong@kernel.org" , "david@fromorbit.com" , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" , "linux-doc@vger.kernel.org" , "gregkh@linuxfoundation.org" , "viro@zeniv.linux.org.uk" , "dvyukov@google.com" Subject: Re: [PATCH v4] slob: add size header to all allocations In-Reply-To: Message-ID: References: <037227db-c869-7d9c-65e8-8f5f8682171d@suse.cz> <20211122013026.909933-1-rkovhaev@gmail.com> <3c996e22-034f-1013-3978-1f786aae38fb@suse.cz> <148d2774-77b9-bb25-c132-80b00e16ea06@suse.cz> <69fc0cead9774dfdba816a8e25f30a53@AcuMS.aculab.com> User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Stat-Signature: whwncagcoff9dyueer54wj3i8zwry3aq X-Rspamd-Queue-Id: 7F2239000257 X-Rspamd-Server: rspam07 Authentication-Results: imf29.hostedemail.com; dkim=none; spf=none (imf29.hostedemail.com: domain of cl@gentwo.org has no SPF policy when checking 161.97.139.209) smtp.mailfrom=cl@gentwo.org; dmarc=none X-HE-Tag: 1638265273-185510 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, 29 Nov 2021, Rustam Kovhaev wrote: > > I'm not sure that helps. > > The header can't share a cache line with the previous item (because it > > might be mapped for DMA) so will always take a full cache line. > > I thought that DMA API allocates buffers that are larger than page size. > DMA pool seems to be able to give out smaller buffers, but underneath it > seems to be calling page allocator. > The SLOB objects that have this header are all less than page size, and > they cannot end up in DMA code paths, or can they? kmalloc slab allocations must return dmaable memory. If the underlying hardware can only dma to a cache line border then all objects must be aligned that way.