Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp5563975pxb; Tue, 16 Feb 2021 01:32:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJwTN35e6q5SJMrBMZ1Ezywi3vgM/8uMK1PTmIPkTl16Sn9W79qXW5lPInhg9IixHx9NE0wn X-Received: by 2002:a17:907:7252:: with SMTP id ds18mr19603562ejc.239.1613467945775; Tue, 16 Feb 2021 01:32:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613467945; cv=none; d=google.com; s=arc-20160816; b=H+Edy08IBJKuqvdDGySpRA7QT8RBxJxTy12/rUiwu3DLSbb09zZoJca+JQwJh+lFMw tB3Xp6NtoQNt2rWka3QAv413OfoUlDf+yARFvR3EAeQw5hJSccL2MgysQdTD3O8WhBW1 vMndF6GIn4z901YmH0Qb0+Cae0bRMn25zj1DayqgDvsfuyq6q6WB8gO2wiTLLagqUoNa FTnq57e4vG9RvjGybP4H2m7063nbYnk/x+dPgRKHd1nNYcteumk4obd5qvJvSlajulfG z3hpTq3seP/9cX0I7Cqkn6JlbA8Q0sNLg7k6VPrnVjbV82CgI+yFuUmriK+gSfDENV4r X/YA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:content-id:mime-version:subject :cc:to:references:in-reply-to:from:organization:dkim-signature; bh=WQwBpcCMDRihoSLkY0nXiJYZq45llCzJSk2sVrYmZu4=; b=bUMYN/zV0r+Qw7MRz9pY3UlM65WYu+e0joeiyYtbXMKwdUbkx/N7GasEaShJgczdtx C0SkbRP7V/Zk2Ual/7AfMwfUSRZ0YrtMOXgLVRx7eptdJBG3x702W4HL93hNZ2bgOdMb wJEagsG+4VThyDNxUKrVhXaVH3744w5lo6TMl5oYB5YEafIZ3ryitNopPli/Q21M2o0i TqSjBpm0gQK9C2iBvnAsBPKavuec7IwHMZiKIwNolb8J5ZQbAEZ4whJ85uy1yXCWBHA1 GelfV2KzwMi9L8SZkHdGsG/FA5JBVKe5/24P5mrMnBdyKtbPt+Qm+T//yFXshwrMP09d 6veA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=bzNcbqdR; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l27si2381492ejk.187.2021.02.16.01.31.53; Tue, 16 Feb 2021 01:32:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=bzNcbqdR; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229983AbhBPJbU (ORCPT + 99 others); Tue, 16 Feb 2021 04:31:20 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:33828 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229903AbhBPJbO (ORCPT ); Tue, 16 Feb 2021 04:31:14 -0500 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 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org 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