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 281B6C433E0 for ; Tue, 16 Feb 2021 09:31:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E3EE064DC3 for ; Tue, 16 Feb 2021 09:31:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229977AbhBPJbU (ORCPT ); Tue, 16 Feb 2021 04:31:20 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:54352 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229928AbhBPJbN (ORCPT ); Tue, 16 Feb 2021 04:31:13 -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: ceph-devel@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