Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751956AbdFNJGL (ORCPT ); Wed, 14 Jun 2017 05:06:11 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:2532 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751829AbdFNJGI (ORCPT ); Wed, 14 Jun 2017 05:06:08 -0400 Subject: Re: [PATCH v2 1/2] libsas: Don't process sas events in static works To: Johannes Thumshirn , , References: <1497425597-18799-1-git-send-email-wangyijing@huawei.com> <1497425597-18799-2-git-send-email-wangyijing@huawei.com> <692abe7a-149f-c1bf-5f28-3e36cad81b5a@suse.de> CC: , , , , , , , , , , , , , , , , , , Yousong He From: wangyijing Message-ID: <5940FC1C.5050000@huawei.com> Date: Wed, 14 Jun 2017 17:04:28 +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: <692abe7a-149f-c1bf-5f28-3e36cad81b5a@suse.de> Content-Type: text/plain; charset="utf-8" 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.0A0B0208.5940FC66.0012,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: 6e340c3f3c25b277893d55a21c416396 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1159 Lines: 39 >> static void notify_ha_event(struct sas_ha_struct *sas_ha, enum ha_event event) >> { >> + struct sas_ha_event *ev; >> + >> BUG_ON(event >= HA_NUM_EVENTS); >> >> - sas_queue_event(event, &sas_ha->pending, >> - &sas_ha->ha_events[event].work, sas_ha); >> + ev = kzalloc(sizeof(*ev), GFP_ATOMIC); >> + if (!ev) >> + return; > GFP_ATOMIC allocations can fail and then no events will be queued *and* we > don't report the error back to the caller. > Yes, it's really a problem, but I don't find a better solution, do you have some suggestion ? > > >> index 64e9cdd..c227a8b 100644 >> --- a/drivers/scsi/libsas/sas_init.c >> +++ b/drivers/scsi/libsas/sas_init.c >> @@ -111,10 +111,6 @@ void sas_hash_addr(u8 *hashed, const u8 *sas_addr) >> >> void sas_hae_reset(struct work_struct *work) >> { >> - struct sas_ha_event *ev = to_sas_ha_event(work); >> - struct sas_ha_struct *ha = ev->ha; >> - >> - clear_bit(HAE_RESET, &ha->pending); >> } > > I don't really get why you need a stubbed out sas_hae_reset(). Can't we > just kill it if it doesn't have anything left to do? I have no idea about this function history, I agree clean it out. > >