Received: by 10.213.65.68 with SMTP id h4csp149396imn; Tue, 3 Apr 2018 17:35:52 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/QnnmF+2OSNWGPXAzsUhiPmyQL8ZKx2accnv9mWupB6d8rj/aafb+xS8wqE6lsU9rpSKXP X-Received: by 10.101.68.68 with SMTP id e4mr10671104pgq.421.1522802152876; Tue, 03 Apr 2018 17:35:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522802152; cv=none; d=google.com; s=arc-20160816; b=SbVaRvZO4pW/oYVn4X8n5c8bldxgI7i+arjq16wDm3/ujDXdImcNXse3ALz7PdXulk pgG0nBb44IAdcDvfoVFBUiB5EZsboXbTKqLpWvcW9PQSipGATMNEfXWr/2Ze5MvQiD2q 2PcsZlOKdr+VtzQWYG7mD/vNnhQ/PF2Dna9qbVyzomBQn2vAZWwrwLJyforBIiSW08FJ YUwFp+9OQA2L2SBly+1pzVvJSF2/rXgmHp8H5eHt+g8+XTCmx7dHA6vJnl/HBwDM5o9z UYkxVk5yLLqMxcTwt2dYExZpLRPBVETq1DsF6WeWaQzaVvyo/RhJBItjubPohQ9fjbKf mU1w== 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=XzEAXkXuiCGWrIe/vRDmtqIA1CcZM4GnpjBvxsftotc=; b=QVGACO871ePQc8wExaNmZEw8RrKZCAy6gsU+8n7pgj/1ShSM8f0rRZ0n5GRnlS/CCZ m1W9eVIM8IwOQUC36zUazzTDJkPJONB8h/wbDuqpbPnAQ5ZZkQJxZFbTqP8O8KkkmO/t zjAz5/syMIVvIjdQ8zSA/z4BJocGSU1obRiZYERb8Df7GQFEYnFa/Y50SUqDvT9SK6EW RYDQxGPXPETxwYkptBeIQ7S5oC0Jr20tDAZVX/NrRD59dW9z9VTuCT9tAI2xPBBRAWS8 Z6SDAQ+TDNHUfOO+9ySdwF8Xvhlm4h3j5759ZmrEKR/d0E4DLuKHpB3JhA+h3itL63FJ nSOg== 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 w23-v6si1827453plk.649.2018.04.03.17.35.38; Tue, 03 Apr 2018 17:35:52 -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 S1753585AbeDDAeI (ORCPT + 99 others); Tue, 3 Apr 2018 20:34:08 -0400 Received: from mga02.intel.com ([134.134.136.20]:10500 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751922AbeDDAeH (ORCPT ); Tue, 3 Apr 2018 20:34:07 -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; 03 Apr 2018 17:34:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,403,1517904000"; d="scan'208";a="217313295" Received: from haiyuewa-mobl1.ccr.corp.intel.com (HELO [10.239.196.76]) ([10.239.196.76]) by fmsmga006.fm.intel.com with ESMTP; 03 Apr 2018 17:34:06 -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> <50ba7cd8-0e14-d8b7-a10c-5dee17946722@linux.intel.com> <143afdd1-bdde-fb9b-d21c-8dc8eeb24e6c@acm.org> From: "Wang, Haiyue" Message-ID: <3b51eb4a-1fe5-097d-9b62-e0e46b7f9d62@linux.intel.com> Date: Wed, 4 Apr 2018 08:34:05 +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: <143afdd1-bdde-fb9b-d21c-8dc8eeb24e6c@acm.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Just a small piece of cake, not so urgent. I just try to understand the code commitment process, such as time etc. :) Thanks! BR, Haiyue On 2018-04-04 02:45, Corey Minyard wrote: > On 04/03/2018 01:00 AM, Wang, Haiyue wrote: >> 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 ? >> > > Yeah, this came in kind of late, and I had some other critical > things I was having to focus on, so I've been kind of out of the loop. > > If it's urgent, I can work on getting it into 4.17 later, but I'd rather > wait on 4.18. > > -corey > >> 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); >> >