Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751865AbdITQJU (ORCPT ); Wed, 20 Sep 2017 12:09:20 -0400 Received: from mail-lf0-f67.google.com ([209.85.215.67]:35510 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751550AbdITQJS (ORCPT ); Wed, 20 Sep 2017 12:09:18 -0400 X-Google-Smtp-Source: AOwi7QC0xwB7VzRrZKevZGbV1G9hQJgSyTQNJgEAeBgtcpvwZ4xZguWQfn0s2nBrcrENgdO2TTx0S8mWqIym4RiVi8Q= MIME-Version: 1.0 X-Originating-IP: [108.49.102.27] In-Reply-To: References: <1504691419-26972-1-git-send-email-kyeongdon.kim@lge.com> From: Paul Moore Date: Wed, 20 Sep 2017 12:09:16 -0400 Message-ID: Subject: Re: [PATCH] selinux: Use kmem_cache for hashtab_node To: Kyeongdon Kim Cc: Stephen Smalley , Eric Paris , James Morris , serge@hallyn.com, elfring@users.sourceforge.net, danielj@mellanox.com, junil0814.lee@lge.com, mka@chromium.org, selinux@tycho.nsa.gov, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1025 Lines: 28 On Thu, Sep 7, 2017 at 7:18 PM, Paul Moore wrote: > On Wed, Sep 6, 2017 at 5:50 AM, Kyeongdon Kim wrote: >> During random test as own device to check slub account, >> we found some slack memory from hashtab_node(kmalloc-64). >> By using kzalloc(), middle of test result like below: >> allocated size 240768 >> request size 45144 >> slack size 195624 >> allocation count 3762 >> >> So, we want to use kmem_cache_zalloc() and that >> can reduce memory size 52byte(slack size/alloc count) per each struct. >> >> Signed-off-by: Kyeongdon Kim >> --- >> security/selinux/ss/hashtab.c | 17 +++++++++++++++-- >> security/selinux/ss/hashtab.h | 4 ++++ >> security/selinux/ss/services.c | 4 ++++ >> 3 files changed, 23 insertions(+), 2 deletions(-) > > This seems reasonale, but I'm going to refrain from merging this until > after the merge window closes. I just merged this into selinux/next, thanks for your patience. -- paul moore www.paul-moore.com