From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2D6EEC433DB for ; Tue, 16 Feb 2021 09:29:50 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A521664D9F for ; Tue, 16 Feb 2021 09:29:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A521664D9F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 159C88D0166; Tue, 16 Feb 2021 04:29:49 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 10ABE8D0140; Tue, 16 Feb 2021 04:29:49 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 01E528D0166; Tue, 16 Feb 2021 04:29:48 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0179.hostedemail.com [216.40.44.179]) by kanga.kvack.org (Postfix) with ESMTP id E009F8D0140 for ; Tue, 16 Feb 2021 04:29:48 -0500 (EST) Received: from smtpin05.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id A8E6318421617 for ; Tue, 16 Feb 2021 09:29:48 +0000 (UTC) X-FDA: 77823608856.05.range90_2e0e13827642 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin05.hostedemail.com (Postfix) with ESMTP id 8F40F1841FC92 for ; Tue, 16 Feb 2021 09:29:48 +0000 (UTC) X-HE-Tag: range90_2e0e13827642 X-Filterd-Recvd-Size: 4136 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf49.hostedemail.com (Postfix) with ESMTP for ; Tue, 16 Feb 2021 09:29:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1613467787; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=WQwBpcCMDRihoSLkY0nXiJYZq45llCzJSk2sVrYmZu4=; b=bzNcbqdRTJB1zWZm7ipwzLN5tMmL5b2XO/cGCS9f207+RnFTN896Z35KoVT+ZtwP2ZxlMz cuDr5LPw2GPYe4NTX/eV5AVUSfZSo7fJj0sYawD2NZvk/l6mLCV6AIg0Kt119hf8w07ZJ+ ZdyQS96rNxMyjIcPt21Nkd1KdNOsuAI= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-46-Zx6-8XXBP9WnKXi9yDelKg-1; Tue, 16 Feb 2021 04:29:43 -0500 X-MC-Unique: Zx6-8XXBP9WnKXi9yDelKg-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0BA5A100A8E8; Tue, 16 Feb 2021 09:29:40 +0000 (UTC) Received: from warthog.procyon.org.uk (ovpn-119-68.rdu2.redhat.com [10.10.119.68]) by smtp.corp.redhat.com (Postfix) with ESMTP id 709A110023AB; Tue, 16 Feb 2021 09:29:32 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: <20210216084230.GA23669@lst.de> References: <20210216084230.GA23669@lst.de> <161340385320.1303470.2392622971006879777.stgit@warthog.procyon.org.uk> <1376938.1613429183@warthog.procyon.org.uk> To: Christoph Hellwig Cc: dhowells@redhat.com, Trond Myklebust , Marc Dionne , Anna Schumaker , Steve French , Dominique Martinet , linux-cifs@vger.kernel.org, ceph-devel@vger.kernel.org, Jeff Layton , Matthew Wilcox , linux-cachefs@redhat.com, Alexander Viro , linux-mm@kvack.org, linux-afs@lists.infradead.org, v9fs-developer@lists.sourceforge.net, linux-fsdevel@vger.kernel.org, linux-nfs@vger.kernel.org, Jeff Layton , David Wysochanski , linux-kernel@vger.kernel.org, Sebastian Andrzej Siewior Subject: Re: [PATCH 34/33] netfs: Use in_interrupt() not in_softirq() MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1419964.1613467771.1@warthog.procyon.org.uk> Date: Tue, 16 Feb 2021 09:29:31 +0000 Message-ID: <1419965.1613467771@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Christoph Hellwig wrote: > On Mon, Feb 15, 2021 at 10:46:23PM +0000, David Howells wrote: > > The in_softirq() in netfs_rreq_terminated() works fine for the cache being > > on a normal disk, as the completion handlers may get called in softirq > > context, but for an NVMe drive, the completion handler may get called in > > IRQ context. > > > > Fix to use in_interrupt() instead of in_softirq() throughout the read > > helpers, particularly when deciding whether to punt code that might sleep > > off to a worker thread. > > We must not use either check, as they all are unreliable especially > for PREEMPT-RT. Is there a better way to do it? The intent is to process the assessment phase in the calling thread's context if possible rather than bumping over to a worker thread. For synchronous I/O, for example, that's done in the caller's thread. Maybe that's the answer - if it's known to be asynchronous, I have to punt, but otherwise don't have to. David