From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751595AbdFFREn (ORCPT ); Tue, 6 Jun 2017 13:04:43 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:36741 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751436AbdFFREm (ORCPT ); Tue, 6 Jun 2017 13:04:42 -0400 Subject: Re: [PATCH v2] arch/sparc: support NR_CPUS = 4096 To: David Miller References: <1496702911-717442-1-git-send-email-jane.chu@oracle.com> <20170605.205739.2124313705421284534.davem@davemloft.net> <6255d34e-499d-db38-ec86-8930828684de@oracle.com> <20170605.232724.386554178947981058.davem@davemloft.net> Cc: tglx@linutronix.de, atish.patra@oracle.com, Liam.Howlett@oracle.com, sparclinux@vger.kernel.org, linux-kernel@vger.kernel.org From: jane.chu@oracle.com Organization: Oracle Corporation Message-ID: Date: Tue, 6 Jun 2017 10:04:25 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <20170605.232724.386554178947981058.davem@davemloft.net> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Source-IP: aserv0022.oracle.com [141.146.126.234] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/05/2017 08:27 PM, David Miller wrote: > From: jane.chu@oracle.com > Date: Mon, 5 Jun 2017 20:03:28 -0700 > >> On sun4v sparc, it looks like kzalloc(64, GFP_KERNEL) ends up >> allocating from kmalloc_caches[6] - a 64-byte kmem-cache allocated >> by kmem_cache_init() with SLAB_HWCACHE_ALIGN flag set, so it's in >> l3-cache-line-size alignment, i.e. 64byte. I printed out the >> 'mondo' pa and verified that. > Please check this, because that is an implementation detail. We have > three SLAB allocators. > > For example, if the user enables SLOB, I bet you don't get that > alignment. > > The only thing we are universally guaranteed is ARCH_KMALLOC_MINALIGN. > > Please implement this properly, rather than relying upon things like > the above. Good point, agreed. I will update the patch. thanks! -jane > > Thank you. From mboxrd@z Thu Jan 1 00:00:00 1970 From: jane.chu@oracle.com Date: Tue, 06 Jun 2017 17:04:25 +0000 Subject: Re: [PATCH v2] arch/sparc: support NR_CPUS = 4096 Message-Id: List-Id: References: <1496702911-717442-1-git-send-email-jane.chu@oracle.com> <20170605.205739.2124313705421284534.davem@davemloft.net> <6255d34e-499d-db38-ec86-8930828684de@oracle.com> <20170605.232724.386554178947981058.davem@davemloft.net> In-Reply-To: <20170605.232724.386554178947981058.davem@davemloft.net> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: David Miller Cc: tglx@linutronix.de, atish.patra@oracle.com, Liam.Howlett@oracle.com, sparclinux@vger.kernel.org, linux-kernel@vger.kernel.org On 06/05/2017 08:27 PM, David Miller wrote: > From: jane.chu@oracle.com > Date: Mon, 5 Jun 2017 20:03:28 -0700 > >> On sun4v sparc, it looks like kzalloc(64, GFP_KERNEL) ends up >> allocating from kmalloc_caches[6] - a 64-byte kmem-cache allocated >> by kmem_cache_init() with SLAB_HWCACHE_ALIGN flag set, so it's in >> l3-cache-line-size alignment, i.e. 64byte. I printed out the >> 'mondo' pa and verified that. > Please check this, because that is an implementation detail. We have > three SLAB allocators. > > For example, if the user enables SLOB, I bet you don't get that > alignment. > > The only thing we are universally guaranteed is ARCH_KMALLOC_MINALIGN. > > Please implement this properly, rather than relying upon things like > the above. Good point, agreed. I will update the patch. thanks! -jane > > Thank you.