Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935191Ab3DJKQs (ORCPT ); Wed, 10 Apr 2013 06:16:48 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:19705 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752688Ab3DJKQq (ORCPT ); Wed, 10 Apr 2013 06:16:46 -0400 X-AuditID: cbfee691-b7f5f6d000002fda-bc-51653c0c9fea Date: Wed, 10 Apr 2013 10:16:44 +0000 (GMT) From: EUNBONG SONG Subject: [PATCH] staging: Enhance cpu load-balance octeon ethernet driver To: david.daney@cavium.com Cc: linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org Reply-to: eunb.song@samsung.com MIME-version: 1.0 X-MTR: 20130410100350345@eunb.song Msgkey: 20130410100350345@eunb.song X-EPLocale: ko_KR.euc-kr X-Priority: 3 X-EPWebmail-Msg-Type: personal X-EPWebmail-Reply-Demand: 0 X-EPApproval-Locale: X-EPHeader: ML X-EPTrCode: X-EPTrName: X-MLAttribute: X-RootMTR: 20130410100350345@eunb.song X-ParentMTR: X-ArchiveUser: X-CPGSPASS: N Content-type: text/plain; charset=euc-kr MIME-version: 1.0 Message-id: <3910056.318101365589004261.JavaMail.weblogic@epml02> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupjleLIzCtJLcpLzFFi42I5/e+Zri6PTWqgweED5haXd81hc2D0+LxJ LoAxissmJTUnsyy1SN8ugSvjT+MypoJbvBVLn29ia2BcwdvFyMkhJKAi0fL/OyOILSFgItG8 aDszhC0mceHeerYuRi6gmmWMEjNmfGeBKTq37BUzRGI+o8TKhrdsIAkWAVWJvbtXgxWxCWhL vP3ygLWLkYNDWMBL4skMDpCwiIC8xJonz9lBbGYBD4ntmzcyQhwhLzH59GWwOK+AoMTJmU+g dilJTLjawQgRV5ZoPfURKi4hMWv6BVYIm1diRvtTqLicxLSva6AekJY4P2sDI8wzi78/horz Sxy7vYMJ5DSQ3if3g2H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ZzQJGllWMoqkFyQXFSekVhnrFibnFpXnpesn5uZsYwQnq2cIdjF/OWx9i FOBgVOLhXWiYEijEmlhWXJl7iFGCg1lJhNdCKzVQiDclsbIqtSg/vqg0J7X4EGMyMP4mMkuJ JucDk2deSbyhsYGxoaGluYGpoZEFacJK4rxPW60DhQTSE0tSs1NTC1KLYLYwcXBKNTDu3/fD wE/gzvkbt9kve9eub7zwvf3XT/WVfxUdEh7dEUv7XXL0r/sjs8KnETufzZ/8ZrVky/sfv2vr S87POvri+82YtheT5ghPT1OpEeRc7F3UerjvOPPR5e7fjTo2iG5cU2BROe+oxN1TE3bZbn95 n3FO3v95C7O+75sW5OlcdKGJJZg/fMGu2UosxRmJhlrMRcWJAOy89omUAwAA DLP-Filter: Pass X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id r3AAGmjb011087 Content-Length: 1411 Lines: 27 Currently, CPU for RX napi handler is scheduled when backlog packet count is greater than budget * cores_in_use. If more cpus are used for RX napi handler, there is low possibility backlog packet count is greater than budget * cores_in_use. This patch makes CPU for RX napi handler is scheduled when backlog packet count is greater than budget. I tested with patch and the result is more cpu is scheduled in traffic congestion situation. Signed-off-by: EunBong Song --- drivers/staging/octeon/ethernet-rx.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/staging/octeon/ethernet-rx.c b/drivers/staging/octeon/ethernet-rx.c index 34afc16..13f9eae 100644 --- a/drivers/staging/octeon/ethernet-rx.c +++ b/drivers/staging/octeon/ethernet-rx.c @@ -300,7 +300,7 @@ static int cvm_oct_napi_poll(struct napi_struct *napi, int budget) int cores_in_use = core_state.baseline_cores - atomic_read(&core_state.available_cores); counts.u64 = cvmx_read_csr(CVMX_POW_WQ_INT_CNTX(pow_receive_group)); backlog = counts.s.iq_cnt + counts.s.ds_cnt; - if (backlog > budget * cores_in_use && napi != NULL) + if (backlog > budget && napi != NULL) cvm_oct_enable_one_cpu(); } -- 1.7.0.4 ????{.n?+???????+%?????ݶ??w??{.n?+????{??G?????{ay?ʇڙ?,j??f???h?????????z_??(?階?ݢj"???m??????G????????????&???~???iO???z??v?^?m???? ????????I?