Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932655AbdGLCIX (ORCPT ); Tue, 11 Jul 2017 22:08:23 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:2989 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754815AbdGLCIV (ORCPT ); Tue, 11 Jul 2017 22:08:21 -0400 Subject: Re: [PATCH v3 1/7] libsas: Use static sas event pool to appease sas event lost To: John Garry , , References: <1499670369-44143-1-git-send-email-wangyijing@huawei.com> <1499670369-44143-2-git-send-email-wangyijing@huawei.com> CC: , , , , , , , , , , , , , , , , , , Johannes Thumshirn , Linuxarm From: wangyijing Message-ID: <5965840B.2000909@huawei.com> Date: Wed, 12 Jul 2017 10:06:03 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.23.4] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A090204.5965848A.00B4,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: db3d716068ddbb7beddc6fd17714ded4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1118 Lines: 26 >> - unsigned long port_events_pending; >> - unsigned long phy_events_pending; >> + struct asd_sas_event port_events[PORT_POOL_SIZE]; >> + struct asd_sas_event phy_events[PHY_POOL_SIZE]; >> >> int error; > > Hi Yijing, > > So now we are creating a static pool of events per PHY/port, instead of having 1 static work struct per event per PHY/port. So, for sure, this avoids the dynamic event issue of system memory exhaustion which we discussed in v1+v2 series. And it seems to possibly remove issue of losing SAS events. > > But how did you determine the pool size for a PHY/port? It would seem to be 5 * #phy events or #port events (which is also 5, I figure by coincidence). How does this deal with flutter of >25 events? There is no special meaning for the pool size, if flutter of > 25 events, notify sas events will return error, and the further step work is depending on LLDD drivers. I hope libsas could do more work in this case, but now it seems a little difficult, this patch may be a interim fix, until we find a perfect solution. Thanks! Yijing. > > Thanks, > John > > > . >