Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp87995img; Wed, 20 Mar 2019 14:49:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqzwo9DG+ocPpqP3mR5passTY4lejPDQ/Mzh/5svyUzoUUId9Zths950VS55aoAMBr2l/yYV X-Received: by 2002:a17:902:1121:: with SMTP id d30mr30403pla.104.1553118543006; Wed, 20 Mar 2019 14:49:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553118542; cv=none; d=google.com; s=arc-20160816; b=pR/y6qFfag5w98c/3IEpbszL6GVZAYgCpjKLI5lf4C8DxEWQKqSmWjVQQfC00K+A/k ho7ogaQODfP3lrR6Nf98NQHbSCaF2HodIHM14jisngm+z+foq7SQeMa5qjH/I8N3sUMa Kh90xYqdWzmMFJHWcMcWvx2nRAn45afHxCQoi2tvRsDRvdrio6TiXOyoJanSgNhHJpoM WzS+6Q5tT166WLqSDq0QgKwR+TDwPYXtehhJxygpxAHBvz5pND4p1WWYkqZsN15tocvd 6u/yZBvTp3c//lZQfvjnNQjxZlJ9/S91soNP8xPEMpU8EUa+UkDSr88fV08yLha6jwgg 09TQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=ti9ripvN2rhcF9NSGZusPod+XiKR1FLqC84BWaRifHI=; b=BhXwR3cX1XmaL6g8/o2cj2iIccNIMHF7WjF51kg1X0MUvva7dvjZ4QPoKka8jlIun8 aENPzOLVH4GECMoTsRS7AbeRk3QzfKA1oH/JHIvmuSz2FGxYiDkFGXZc3CWCnIISCvi/ y3fU5piMGgUNt8cYpfe6XNLxpLhDatb0fbNKMpeO1ThofZsTVzvYn7QYFSOfjU8D71gQ weIeJZsHmOvhcNcQgvZMd7KK4u/rIWnPwN28lCH2T2w8YISoF0jG57ZuY1RWg44uBMuD vs5rzKnaa/CuKGnW0LSU9fa7+UCBUUwXoe26Ki6JC09Za4CxXgqm/NGCxxskWQ4aEv5G DJzw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u73si2750412pfj.30.2019.03.20.14.48.47; Wed, 20 Mar 2019 14:49:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727546AbfCTVsI (ORCPT + 99 others); Wed, 20 Mar 2019 17:48:08 -0400 Received: from mx2.suse.de ([195.135.220.15]:43204 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727381AbfCTVsI (ORCPT ); Wed, 20 Mar 2019 17:48:08 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id B61CEAFBD; Wed, 20 Mar 2019 21:48:06 +0000 (UTC) Subject: Re: [RFC 0/2] guarantee natural alignment for kmalloc() To: Matthew Wilcox Cc: Christopher Lameter , linux-mm@kvack.org, Pekka Enberg , David Rientjes , Joonsoo Kim , Ming Lei , Dave Chinner , "Darrick J . Wong" , Christoph Hellwig , Michal Hocko , linux-kernel@vger.kernel.org, linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org References: <20190319211108.15495-1-vbabka@suse.cz> <01000169988d4e34-b4178f68-c390-472b-b62f-a57a4f459a76-000000@email.amazonses.com> <5d7fee9c-1a80-6ac9-ac1d-b1ce05ed27a8@suse.cz> <20190320185347.GZ19508@bombadil.infradead.org> From: Vlastimil Babka Message-ID: Date: Wed, 20 Mar 2019 22:48:03 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.0 MIME-Version: 1.0 In-Reply-To: <20190320185347.GZ19508@bombadil.infradead.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/20/2019 7:53 PM, Matthew Wilcox wrote: > On Wed, Mar 20, 2019 at 09:48:47AM +0100, Vlastimil Babka wrote: >> Natural alignment to size is rather well defined, no? Would anyone ever >> assume a larger one, for what reason? >> It's now where some make assumptions (even unknowingly) for natural >> There are two 'odd' sizes 96 and 192, which will keep cacheline size >> alignment, would anyone really expect more than 64 bytes? > > Presumably 96 will keep being aligned to 32 bytes, as aligning 96 to 64 > just results in 128-byte allocations. Well, looks like that's what happens. This is with SLAB, but the alignment calculations should be common: slabinfo - version: 2.1 # name : tunables : slabdata kmalloc-96 2611 4896 128 32 1 : tunables 120 60 8 : slabdata 153 153 0 kmalloc-128 4798 5536 128 32 1 : tunables 120 60 8 : slabdata 173 173 0