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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 99474C48294 for ; Fri, 2 Feb 2024 10:30:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BF9A16B0074; Fri, 2 Feb 2024 05:30:45 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id BA72A6B007B; Fri, 2 Feb 2024 05:30:45 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A6D736B007D; Fri, 2 Feb 2024 05:30:45 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 975FC6B0074 for ; Fri, 2 Feb 2024 05:30:45 -0500 (EST) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 6511EA0154 for ; Fri, 2 Feb 2024 10:30:45 +0000 (UTC) X-FDA: 81746495250.03.41E15BB Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf04.hostedemail.com (Postfix) with ESMTP id 1F55C4000A for ; Fri, 2 Feb 2024 10:30:41 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Z+zPkK+C; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf04.hostedemail.com: domain of dhowells@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1706869842; a=rsa-sha256; cv=none; b=eTU1BZ2ahvwXM7kpo6rMghR2Vx9WZv6b3K4ewCEuBDUtmAcXFL+q/6MYlzbkfnmNe50IGF EsFmlsCPL+zEtiUILC2Fz9ljY1WrFqAmmnyF5hvYlzpgj3uYtefBn9PzXhBgBjixtXqEGR qsb7XWL9DAQ8ntYnJQxtjkUEoxWnYZc= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Z+zPkK+C; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf04.hostedemail.com: domain of dhowells@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1706869842; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=5htgxDobsa2ufZAg9x3xAeGYc24d2Ai20T7JxwVTcN0=; b=PRfyMoqCGrhOk7FT0coP/F7FkGsaiSPUvAHSup7CqygWOjhbTUF7PvfcMdpc0uxLV5aC+U M78YAstVbtCJ+YHXuPt3u0JaLmr99GyxqnLXpu30dumlCD6YJaMgN7X0+C8enoaWbAqmOG QhCrzO/Hz6/zf4R2i+BNNcL0qaLNRM8= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1706869841; 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=5htgxDobsa2ufZAg9x3xAeGYc24d2Ai20T7JxwVTcN0=; b=Z+zPkK+CapE2XzylHvL+99u3QEcMyfmjHPdQTRhCsubgh25eZM5nVL/LSBpW4mx8GBJNNP hfh9wGgJRQWG5W97MadnG+yFrkR1NhXVFcCQpzTHyGNwPVnTs1hruaMyX+maTlqbsYtYGg s23U9qROZOuBnxi543+g9TcNsJ+4nHo= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-583-cvMLszvfOgS4t4W1plW-4g-1; Fri, 02 Feb 2024 05:30:39 -0500 X-MC-Unique: cvMLszvfOgS4t4W1plW-4g-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id AC2A11C04B65; Fri, 2 Feb 2024 10:30:38 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.42.28.245]) by smtp.corp.redhat.com (Postfix) with ESMTP id 383632026D66; Fri, 2 Feb 2024 10:30:37 +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: References: <2701318.1706863882@warthog.procyon.org.uk> To: Miklos Szeredi Cc: dhowells@redhat.com, lsf-pc@lists.linux-foundation.org, Matthew Wilcox , Kent Overstreet , dwmw2@infradead.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [LSF/MM/BPF TOPIC] Replacing TASK_(UN)INTERRUPTIBLE with regions of uninterruptibility MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2704766.1706869832.1@warthog.procyon.org.uk> Date: Fri, 02 Feb 2024 10:30:32 +0000 Message-ID: <2704767.1706869832@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.4 X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 1F55C4000A X-Stat-Signature: shoyr7gdnqtcswfxmckfncexpbuzmfac X-HE-Tag: 1706869841-694762 X-HE-Meta: U2FsdGVkX1932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jC8CuLRI6+JuWxm7BUf/BR9THRGl66/a8YhSDIwzqFKxA0w1Z/nC42KAVGbIAk3uiMFdZKUPgSeV5uLIn2GxNiuTncGu5I= 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: List-Subscribe: List-Unsubscribe: Miklos Szeredi wrote: > > We have various locks, mutexes, etc., that are taken on entry to > > filesystem code, for example, and a bunch of them are taken interruptibly > > or killably (or ought to be) - but filesystem code might be called into > > from uninterruptible code, such as the memory allocator, fscache, etc.. > > Are you suggesting to make lots more filesystem/vfs/mm sleeps > killable? That would present problems with being called from certain > contexts. No, it wouldn't. What I'm suggesting is something like: overlayfs_mkdir(inode) { inode_lock(inode); <--- This could be interruptible ... begin_task_uninterruptible(); ... do_stuff(); ... inode->lower->inode->mkdir(inode->lower->inode); ^--- say ext4_mkdir ... do_more_stuff(); end_task_uninterruptible(); inode_unlock(inode); } ext4_mkdir(inode) { inode_lock(inode); <--- This would be interruptible, but called from overlayfs above is now uninterruptible ... } You bracket the context where interruptibility is bad and then everyone you call is forced to be uninterruptible. This would need to be nestable also: begin_task_uninterruptible(); begin_task_uninterruptible(); begin_task_uninterruptible(); ... end_task_uninterruptible(); // must not become interruptible end_task_uninterruptible(); // nor this end_task_uninterruptible(); // from here *could* be interruptible again Obviously, we would need to gradate this to accommodate killability also. David