Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp2285086pxb; Mon, 11 Jan 2021 06:04:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJyiHYwb3SDgq4eQNZDSWcB94Kx7k7W3AANwbuo1J1vIRj6B1T/tj9PBE1+9Bv6yTFjoIy+H X-Received: by 2002:a17:906:653:: with SMTP id t19mr10978374ejb.44.1610373874797; Mon, 11 Jan 2021 06:04:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610373874; cv=none; d=google.com; s=arc-20160816; b=kZ4rR4c71Uasi+GYIXs/ST3ff2fJwZYgBZwG4S5kx/jZiEKDvil44IErHkxwzQ+p2k FJUBtGkm3rTy3DjQAq8ZjOs93y1zMgfiwmKO7CiNXCxNIuxKEuKCTD4MLxz0rIHKCOj8 uylzBymRJktuIyZP5k83xIObycB0jWkan+Ng2Aowb1JAS37fjGh/utfFxIjgXln/EGbO oD8TMZvlVDoCSp4owz2MwD80nFmtJ9a8faQ8+MUs0Uxc3TyXFQsunCxM/7eEPJcTiBJr zi0Rpz2tUTBN7iFTTGGdFuoSiUQ7iEyFlH52BQ2yZAnr1olxm+7onflh51Gg1YwbwW9o Bi6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=GpsfyFq2kbXSlFvcw1mtIkbEwNhVUMlJQ92NMx2xxC4=; b=jxCkmW+hT3/fczf5AudNfVkxViqkgpJes46JT5sj9ykKyk+nscGlAjDlN3mEMepPrK LiYt8y9p3yxjfMCQHvAW5LbIv0NWSJg+gQO8gjRhCmD2ggSjFK8TRhHnQzyhrckhdxSl twvNT/ZW1MigaDCOYPxdokEdpFweoRdaS/vdsd9Kiz9QWnNco1vYduabrBJb5fC+SFcE YfWGBZuxsDkcoWOWg/W48YTx4pqYa9ENElSG9fvZgttyrVHIsauMoveNW6K5vClDU/Fj 0K5N1D6EwvBcNsPBMUd9iZl3X4OabO6bLMleIXdHTRsfEueKnmz0kAhvLinX/c273eht 6drg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e20si6785387edr.131.2021.01.11.06.04.07; Mon, 11 Jan 2021 06:04:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731190AbhAKOBR (ORCPT + 99 others); Mon, 11 Jan 2021 09:01:17 -0500 Received: from frasgout.his.huawei.com ([185.176.79.56]:2305 "EHLO frasgout.his.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730503AbhAKOBP (ORCPT ); Mon, 11 Jan 2021 09:01:15 -0500 Received: from fraeml736-chm.china.huawei.com (unknown [172.18.147.226]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4DDwFv0qCjz67Zn2; Mon, 11 Jan 2021 21:55:31 +0800 (CST) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by fraeml736-chm.china.huawei.com (10.206.15.217) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Mon, 11 Jan 2021 15:00:33 +0100 Received: from [10.210.171.188] (10.210.171.188) by lhreml724-chm.china.huawei.com (10.201.108.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2106.2; Mon, 11 Jan 2021 14:00:31 +0000 Subject: Re: [PATCH 00/11] scsi: libsas: Remove in_interrupt() check To: "Ahmed S. Darwish" , Jason Yan CC: Hannes Reinecke , "James E.J. Bottomley" , "Martin K. Petersen" , Daniel Wagner , Artur Paszkiewicz , Jack Wang , , LKML , "Thomas Gleixner" , "Sebastian A. Siewior" References: From: John Garry Message-ID: Date: Mon, 11 Jan 2021 13:59:25 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.1.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [10.210.171.188] X-ClientProxiedBy: lhreml703-chm.china.huawei.com (10.201.108.52) To lhreml724-chm.china.huawei.com (10.201.108.75) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/01/2021 13:43, Ahmed S. Darwish wrote: > Hi John, Jason, > > On Tue, Dec 22, 2020 at 12:54:58PM +0000, John Garry wrote: >> On 22/12/2020 12:30, Jason Yan wrote: >>>>      return event; >>>> >>>> >>>> So default for phy->ha->event_thres is 32, and I can't imagine that >>> The default value is 1024. >> Ah, 32 is the minimum allowed set via sysfs. >> >>>> anyone has ever reconfigured this via sysfs or even required a value >>>> that large. Maybe Jason (cc'ed) knows better. It's an arbitrary >>>> value to say that the PHY is malfunctioning. I do note that there is >>>> the circular path sas_alloc_event() -> sas_notify_phy_event() -> >>>> sas_alloc_event() there also. >>>> >>>> Anyway, if the 32x event memories were per-allocated, maybe there is >>>> a clean method to manage this memory, which even works in atomic >>>> context, so we could avoid this rework (ignoring the context bugs >>>> you reported for a moment). I do also note that the sas_event_cache >>>> size is not huge. >>>> >>> Pre-allocated memory is an option.(Which we have tried at the very >>> beginnig by Wang Yijing.) >> Right, I remember this, but I think the concern was having a proper method >> to manage this pre-allocated memory then. And same problem now. >> >>> Or directly use GFP_ATOMIC is maybe better than passing flags from lldds. >>> >> I think that if we don't really need this, then should not use it. >> > Kind reminder. Do we have any consensus here? > Hi Ahmed, To me, what you're doing seems fine. I was looking for some API to manage small memory pools and which is atomic safe to avoid passing the context flag, but I didn't find such a thing. Just one other thing to mention: I have a patch to remove the indirection in libsas notifiers: https://github.com/hisilicon/kernel-dev/commit/87fcd7e113dc05b7933260e7fa4588dc3730cc2a I was going to send it today. Hopefully, if community has no problem with it, you can make your changes with that in mind. Thanks, John