Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2460554ybl; Thu, 29 Aug 2019 08:28:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqy2GWj4yCat4v1t9p1sCCN4lIWYkZvz43iPAlfTgxuKf6mehjuCnxm8nmH7EHOr39Y2jAu5 X-Received: by 2002:a17:90a:b894:: with SMTP id o20mr10628410pjr.41.1567092521692; Thu, 29 Aug 2019 08:28:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567092521; cv=none; d=google.com; s=arc-20160816; b=C6wuFMcl9F7aAheHQY9Pc+u14cm4cPUESAxyGn7bS76//Hd9Q9L1yQqafrdJ8vE1ew jrstyZVnqnvt0r/LvOxqL3MPOX5H3uCpA78frZcBkNfy2D0ywbj4ar/VJV4FQjrmp7WM kvtLmPlz1oQ1BsbVs/SwPdjcPGeXJ+5f0F3v7iDFGh2ej1cR6/fszeAHC02g6IdRoXlU L1UjDF2IbBm2UGCmMC79Qa7/lnhdADl7cCUlqCWGBcm3twN83g+lb3zmTXA2hvl2OCFq yH0NN+0QlbDAV3sGawBr39/g8uHtst7s9Q98PVeZILbjDMHuLGVuQ2PyXLLJztRCdptm zTTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=/3YgXXFVh80Nm/iOowFTb99mbdDyzLvXINagoSIlUxA=; b=TsY5YKdZfdEcXNQO56poTh7reKYvqkHRf5rD/eoLSu+Cp021ntxYyc1lyqbO6jKigt /35C1khKAOpl534iTqygDRbRROg1yKazPoQ+7i6Sf0cnQlFJCeAznfpF27JKztMVu280 1HlI316U7XrbtkMdHEFVk0Qs/4qFhuag5/cENb4qKnVS3rfqDVvJbVUIElQF8nNoZDWV w8uAxnJRUUHSCKWvvFwZitel2Q9Q2nxGblJWcH3SZ5b5ao2KdU1pVVW9hpgwD+M0J100 MywQApALC7eY//5zF00/POXycvpc6C3L24XIQehOCcCi6iv54o+NjUQ2YCjiPdihZQRC TrLA== 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 h6si2481210pjk.100.2019.08.29.08.28.25; Thu, 29 Aug 2019 08:28:41 -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 S1727495AbfH2P12 (ORCPT + 99 others); Thu, 29 Aug 2019 11:27:28 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:52826 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726739AbfH2P12 (ORCPT ); Thu, 29 Aug 2019 11:27:28 -0400 Received: from [213.220.153.21] (helo=wittgenstein) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1i3MKZ-00031b-0r; Thu, 29 Aug 2019 15:27:23 +0000 Date: Thu, 29 Aug 2019 17:27:22 +0200 From: Christian Brauner To: Joel Fernandes Cc: Greg KH , Peikan Tsai , arve@android.com, tkjos@android.com, maco@android.com, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] binder: Use kmem_cache for binder_thread Message-ID: <20190829152721.ttsyfwaeygmwmcu7@wittgenstein> References: <20190829054953.GA18328@mark-All-Series> <20190829064229.GA30423@kroah.com> <20190829135359.GB63638@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190829135359.GB63638@google.com> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 29, 2019 at 09:53:59AM -0400, Joel Fernandes wrote: > On Thu, Aug 29, 2019 at 08:42:29AM +0200, Greg KH wrote: > > On Thu, Aug 29, 2019 at 01:49:53PM +0800, Peikan Tsai wrote: > [snip] > > > The allocated size for each binder_thread is 512 bytes by kzalloc. > > > Because the size of binder_thread is fixed and it's only 304 bytes. > > > It will save 208 bytes per binder_thread when use create a kmem_cache > > > for the binder_thread. > > > > Are you _sure_ it really will save that much memory? You want to do > > allocations based on a nice alignment for lots of good reasons, > > especially for something that needs quick accesses. > > Alignment can be done for slab allocations, kmem_cache_create() takes an > align argument. I am not sure what the default alignment of objects is > though (probably no default alignment). What is an optimal alignment in your > view? Probably SLAB_HWCACHE_ALIGN would make most sense. > > > Did you test your change on a system that relies on binder and find any > > speed improvement or decrease, and any actual memory savings? > > > > If so, can you post your results? > > That's certainly worth it and I thought of asking for the same, but spoke too > soon! Yeah, it'd be interesting to see what difference this actually makes. Christian