Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp4268257rwb; Tue, 20 Sep 2022 11:10:13 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7uohKIKVA4QT9VVQNWB4e4qlB+CD4hOuCBxyE7xHrNa/bAoJuPJAyT92f5NDsjWfwreG7f X-Received: by 2002:a05:6402:278c:b0:451:fabf:d885 with SMTP id b12-20020a056402278c00b00451fabfd885mr20815014ede.91.1663697413273; Tue, 20 Sep 2022 11:10:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663697413; cv=none; d=google.com; s=arc-20160816; b=SsAfyCtMPhwkS8h4mjcR21rGcg+xKFtJjQM4W+H4d+zhahQylQHH8oAzh5DPLuAjgp Dxk+MKl6zfm8N+MGBv6P7TFwn9u+ac2EwLcmYSsJedOeG9ZXMSgPS7I9GYJ60s4tEU+h raMEhyn1PJYWTnVlQP14aJNehKdBaOMnwb+9jBDXOG4frMkNeiiIrL8eG/HT/IFhThSP aUYr2hGVl4iBcGoKLNgibiuJrwkTI/GagY+qZaLIjq1gPbwJLbSA9Ax93ELmxUlZy19+ envkzXEf7npcVZ/pjHgxYBtB2rSsR84hdlkaArvN/qkHZDr0MRX9mZnRzpXVV2stLGVQ KjPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=LS+xvqH5TidkBm9cBo74q89x2X9YMXuEfVMD6zijR4Y=; b=A71Jt5YZ5HQkS2Gsu+4m0x4hljGd3XfKhG6pwt5HgvESkJuaYsX83E6G3cWtHU/D6G cXPtVtNSd/SuS3ziwCx5Z3pjEYl0SgM6wbOpQ5MdiiwulImC51BziOqwS3Qg4mTjblcT jiHYTatBGb5l77eztpcfaEP0loawCoi/3km9zzwEmwIGhxonMZvSjCXfK3JTaifMEBZf ZOXqoD4h+GgsPmUcJEf5t5KCdThcVd1eOCiqrnhAD532L2znchdJ2b0DHPcDc8Zr6HRI vd38DCcHxMn1Xf2e3Puzi2MK+UsKSeiUp4PTQzYBZ7UvmizOr3FttgfOK4rbQdvtKkVn 3A1g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=acm.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bm14-20020a170906c04e00b007800b1f8d98si320007ejb.452.2022.09.20.11.09.44; Tue, 20 Sep 2022 11:10:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=acm.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230011AbiITRNs (ORCPT + 99 others); Tue, 20 Sep 2022 13:13:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32900 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229503AbiITRNq (ORCPT ); Tue, 20 Sep 2022 13:13:46 -0400 Received: from mail-pf1-f170.google.com (mail-pf1-f170.google.com [209.85.210.170]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 277BE5FAF2; Tue, 20 Sep 2022 10:13:44 -0700 (PDT) Received: by mail-pf1-f170.google.com with SMTP id d82so3334668pfd.10; Tue, 20 Sep 2022 10:13:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date; bh=LS+xvqH5TidkBm9cBo74q89x2X9YMXuEfVMD6zijR4Y=; b=xb1zjZixp5HlY+1ocq/NN8zz71jHw7p0RnjmtMToSPK3cGJY2Lv+i++FOy4JvlPuEb xWKY26Z2EciILHgG9dfX7wJJ2A+KoTBEUmdAfnSKribbrf3wSCS5Y2b3RvivYGsK9ZQH 7s5fCmtaUJ5DBERd7MvJzuyDKG3iFSQPyxxGvmPpIJgY70Zhk5ijCu9QWZx32I7j2Jty JTzX+BXhyrtTMIRuiEHYr5ExxP3/4Byav/7zaZzEreHLCQJXenqcCN/urTPX8jxg/Nu+ 8lr6o6ir7jzORy+r4pomTBblwaS5MJvyt1Qsvshd7u33RHa4c8Syn7JT5Rcj4SiT1yPV RD1g== X-Gm-Message-State: ACrzQf0y+Wvz6ymlES3XfB3pHtnSWNVSjUpZtrSpr8Hexhi+MOoS6W0U T1u707b0JagxWn5A1H5VqfA= X-Received: by 2002:a63:5d0c:0:b0:43b:a2df:858 with SMTP id r12-20020a635d0c000000b0043ba2df0858mr2909730pgb.442.1663694023429; Tue, 20 Sep 2022 10:13:43 -0700 (PDT) Received: from ?IPV6:2620:15c:211:201:c7e0:1691:74c9:2e9? ([2620:15c:211:201:c7e0:1691:74c9:2e9]) by smtp.gmail.com with ESMTPSA id i8-20020aa796e8000000b0053db6f7d2f1sm121469pfq.181.2022.09.20.10.13.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 20 Sep 2022 10:13:42 -0700 (PDT) Message-ID: Date: Tue, 20 Sep 2022 10:13:40 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.13.0 Subject: Re: [PATCH v5 6/7] module: Improve support for asynchronous module exit code Content-Language: en-US To: Luis Chamberlain Cc: "Martin K . Petersen" , linux-scsi@vger.kernel.org, Christoph Hellwig , Ming Lei , Hannes Reinecke , John Garry , Mike Christie , Krzysztof Kozlowski , Greg Kroah-Hartman , linux-modules@vger.kernel.org, linux-kernel@vger.kernel.org, "James E.J. Bottomley" , Tejun Heo References: <20220914225621.415631-1-bvanassche@acm.org> <20220914225621.415631-7-bvanassche@acm.org> From: Bart Van Assche In-Reply-To: <20220914225621.415631-7-bvanassche@acm.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.6 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/14/22 15:56, Bart Van Assche wrote: > Some kernel modules call device_del() from their module exit code and > schedule asynchronous work from inside the .release callback without waiting > until that callback has finished. As an example, many SCSI LLD drivers call > scsi_remove_host() from their module exit code. scsi_remove_host() may > invoke scsi_device_dev_release_usercontext() asynchronously. > scsi_device_dev_release_usercontext() uses the host template pointer and > that pointer usually exists in static storage in the SCSI LLD. Support > using the module reference count to keep the module around until > asynchronous module exiting has completed by waiting in the delete_module() > system call until the module reference count drops to zero. Hi Luis, I'd like to know your opinion about this patch since you are the maintainer of the kernel module system. Thanks, Bart.