Received: by 10.213.65.68 with SMTP id h4csp3151819imn; Mon, 2 Apr 2018 23:02:06 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/aisFF/iIroxgqyrQpx6prY+BSePIjX1Z8C+F4Z8N7avLfQQ8zmRxas4Z+B31UOmWK2YqP X-Received: by 2002:a17:902:24c:: with SMTP id 70-v6mr12744274plc.384.1522735326953; Mon, 02 Apr 2018 23:02:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522735326; cv=none; d=google.com; s=arc-20160816; b=EK0a4TZBpHcdqD6RJIbG5ZTg2Y98SY4kblmVg750KfiMTnQUcK2F2rNpNTpRCDHlDr ZNgIqelZekDodCkTw8m9zHD3qRKz3txRZYYEDrjibcELUNPRfBMG4NBnauPzzyFbQTZL uGRoC0gIsN8Zx4v8NoZQVtOnS+yONxjrguhqHmInf1PmUX0W3KqRpQctm/X7XGPo7rS4 3m+wuhLA1nw8gY4/aYwEJAVhZ/7inm1L2ny8WlczY6vZ1DARK1tf5LgCoqBzZdaUYa3Z 9s1PT+Wf5D5qHvfbK71TveAGPb9kzdllu8E4fwptrRIJO11aKu4+XOT1oVz3NkLeRuGL zurw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject:arc-authentication-results; bh=hmHbEW/gF1lSfKj4WeZD/pGz/hm9SMwGvqUKuada7Rg=; b=eglfnh5A3l/niHx7fE4Pg/H126zX1s3xFiKriqtti/dGG5mtVvmem4MC4GbRoBHgtq rictSvq0+YqzugqYsc96Lt383LYEWnXvvgaB/Xb2HdfS/DEy2wZmn0OsMIm9aTbOn101 PfoDog/JUARIpxduGJ/RpuPuc3WZwvvZns230lPx/FQXvGjFNgTIQLGwb3+BKzWDeqXl DiHUv9fkn4iRRx6I+lvrKJ0p+vu1CGhdzXzJSQGcmzMTRAPQcnq3U+29QFv9Kr4HgO++ dbLo70O2NTZkN2/nK8Lni963i/TIjlc/QUISeW4VH6i/P9sX41eM0Hk4VRkpywLNpUU+ 5cYA== 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 v24si1551599pff.274.2018.04.02.23.01.52; Mon, 02 Apr 2018 23:02:06 -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 S1754870AbeDCGAc (ORCPT + 99 others); Tue, 3 Apr 2018 02:00:32 -0400 Received: from mga02.intel.com ([134.134.136.20]:63204 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754835AbeDCGAb (ORCPT ); Tue, 3 Apr 2018 02:00:31 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Apr 2018 23:00:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,398,1517904000"; d="scan'208";a="217041619" Received: from haiyuewa-mobl1.ccr.corp.intel.com (HELO [10.239.196.40]) ([10.239.196.40]) by fmsmga006.fm.intel.com with ESMTP; 02 Apr 2018 23:00:30 -0700 Subject: Re: [PATCH ipmi/kcs_bmc v1] ipmi: kcs_bmc: optimize the data buffers allocation To: minyard@acm.org, openipmi-developer@lists.sourceforge.net, linux-kernel@vger.kernel.org References: <1521116452-4993-1-git-send-email-haiyue.wang@linux.intel.com> From: "Wang, Haiyue" Message-ID: <50ba7cd8-0e14-d8b7-a10c-5dee17946722@linux.intel.com> Date: Tue, 3 Apr 2018 14:00:29 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <1521116452-4993-1-git-send-email-haiyue.wang@linux.intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Corey, The 4.17 merge window is opened now, this patch is not yet in linux-next tree, so it will be merged into 4.18 ? Thanks & Regards, Haiyue On 2018-03-15 20:20, Haiyue Wang wrote: > Allocate a continuous memory block for the three KCS data buffers with > related index assignment. > > Signed-off-by: Haiyue Wang > --- > drivers/char/ipmi/kcs_bmc.c | 10 ++++++---- > 1 file changed, 6 insertions(+), 4 deletions(-) > > diff --git a/drivers/char/ipmi/kcs_bmc.c b/drivers/char/ipmi/kcs_bmc.c > index fbfc05e..dc19c0d 100644 > --- a/drivers/char/ipmi/kcs_bmc.c > +++ b/drivers/char/ipmi/kcs_bmc.c > @@ -435,6 +435,7 @@ static const struct file_operations kcs_bmc_fops = { > struct kcs_bmc *kcs_bmc_alloc(struct device *dev, int sizeof_priv, u32 channel) > { > struct kcs_bmc *kcs_bmc; > + void *buf; > > kcs_bmc = devm_kzalloc(dev, sizeof(*kcs_bmc) + sizeof_priv, GFP_KERNEL); > if (!kcs_bmc) > @@ -448,11 +449,12 @@ struct kcs_bmc *kcs_bmc_alloc(struct device *dev, int sizeof_priv, u32 channel) > mutex_init(&kcs_bmc->mutex); > init_waitqueue_head(&kcs_bmc->queue); > > - kcs_bmc->data_in = devm_kmalloc(dev, KCS_MSG_BUFSIZ, GFP_KERNEL); > - kcs_bmc->data_out = devm_kmalloc(dev, KCS_MSG_BUFSIZ, GFP_KERNEL); > - kcs_bmc->kbuffer = devm_kmalloc(dev, KCS_MSG_BUFSIZ, GFP_KERNEL); > - if (!kcs_bmc->data_in || !kcs_bmc->data_out || !kcs_bmc->kbuffer) > + buf = devm_kmalloc_array(dev, 3, KCS_MSG_BUFSIZ, GFP_KERNEL); > + if (!buf) > return NULL; > + kcs_bmc->data_in = buf; > + kcs_bmc->data_out = buf + KCS_MSG_BUFSIZ; > + kcs_bmc->kbuffer = buf + KCS_MSG_BUFSIZ * 2; > > kcs_bmc->miscdev.minor = MISC_DYNAMIC_MINOR; > kcs_bmc->miscdev.name = dev_name(dev);