Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp2815051rdb; Mon, 4 Dec 2023 08:14:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IEl660HJkLWzMbtyft6BGDul4FdqIOqqEZTyLVW8jLaLn9dUhUiE3844nFDbm23mg+qEUMR X-Received: by 2002:a05:6359:629a:b0:170:17eb:b4b with SMTP id se26-20020a056359629a00b0017017eb0b4bmr2567924rwb.53.1701706451747; Mon, 04 Dec 2023 08:14:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701706451; cv=none; d=google.com; s=arc-20160816; b=eW5lWCBNQyuKjEI+Exfs+7j3WBwztVTXuk/WN0z7fP87ciWqGVx2eR57ewU0EYdG/a POBWb+sG2Pnhp+hrv/ZfGfrtDy2qhyw6lpKKRqYa+rKqLPgX5JHwN+vG9L7Ny4sTW9kq ix+ox0CCunUY864do4l48Gl6cwvgMCBfJXwHqKSYweXJDrytJwH7FY6D0GTGGkdUg1Jc Tb2itpAMXBvvbcSYAftzoZ22m5DhZa4wuGPFjgVliwXjPSj8/AHQC9d9ekOtlbPuQ2bs BzQ51NsVraVTaoRRZwfBt5OQ2DtQCifb3+QFlwHKbucCRYdq1oFOA/+0QPvElByIbecP vb1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date:dkim-signature; bh=2+iDr/P+1Bne1w6lrvRu/pfnDeZlU730URyMsIIhmOk=; fh=B56+FR/NrjVxjDBvaOl3dHVjWDIN13pADsFPE6B+liY=; b=TmFpOyOifMOjE8e1K7xOcLN4loCsPakUddlrmp6wrflQJbk1eW6/bCUrVfobnzeuNb zQW/6/ixYc3hLZIu5wAx/glTljGYD5wo6Ax5f13rZtv+RZsH7znFNyyi4Bfv8zf1z/Mc 64f7ubxnDGnLD8FDPyhummixJiroApNVEZ0xkHY0kPkx+Pljmjvah65XQji/bpB8Cl0H 7AvF9GgDWwCcrPJVseflpJ3qsDB1ROfRRtO51MoyFc2+DFR4aY+VcnI05xvqGOtYD5r0 KxWixhHscrnYWWJkSxZf6gbgjhGf6Gwr5iLGRDScM3rKMvZKHpGTENOkeimkUVYZRQ5M /fRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=SOnVWrYR; spf=pass (google.com: domain of linux-nfs+bounces-301-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-nfs+bounces-301-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id u16-20020a0cf890000000b0067aa15ea4d2si6825207qvn.307.2023.12.04.08.14.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Dec 2023 08:14:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs+bounces-301-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=SOnVWrYR; spf=pass (google.com: domain of linux-nfs+bounces-301-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-nfs+bounces-301-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 7D5F81C20A3E for ; Mon, 4 Dec 2023 16:14:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 676E62D796; Mon, 4 Dec 2023 16:14:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="SOnVWrYR" X-Original-To: linux-nfs@vger.kernel.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F11DAAC for ; Mon, 4 Dec 2023 08:14:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1701706442; 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=2+iDr/P+1Bne1w6lrvRu/pfnDeZlU730URyMsIIhmOk=; b=SOnVWrYR90gEy9Vxir/0ydlZ2IGWz6vJFXhsnevGjBv5z48tWJMCzAUNbq1L76yXe4STXo VLGsFdg47rbHJQldFhLHYaODMHtA6Z62KJii9i8YsJamxlCVHct0inJwXqMdejZe5mzCop kZcoZduCOu6h2SDuyxtnLicQiUuC7DM= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-633-fxN3OT9QPt-YonZ6_cEPwg-1; Mon, 04 Dec 2023 11:13:57 -0500 X-MC-Unique: fxN3OT9QPt-YonZ6_cEPwg-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (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 B23EE8007B3; Mon, 4 Dec 2023 16:13:56 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.45.224.82]) by smtp.corp.redhat.com (Postfix) with SMTP id CE6D22166B26; Mon, 4 Dec 2023 16:13:53 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Mon, 4 Dec 2023 17:12:49 +0100 (CET) Date: Mon, 4 Dec 2023 17:12:45 +0100 From: Oleg Nesterov To: Al Viro Cc: NeilBrown , Christian Brauner , Jens Axboe , Chuck Lever , Jeff Layton , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nfs@vger.kernel.org Subject: Re: [PATCH 1/2] Allow a kthread to declare that it calls task_work_run() Message-ID: <20231204161245.GA31326@redhat.com> References: <20231204014042.6754-1-neilb@suse.de> <20231204014042.6754-2-neilb@suse.de> <20231204024031.GV38156@ZenIV> Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231204024031.GV38156@ZenIV> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.6 I am sick and can't read emails, just one note On 12/04, Al Viro wrote: > > Just have the kernel threads born with ->task_works set to &work_exited Then irq_thread()->task_work_add() will silently fail, > and provide a primitive that would flip it from that to NULL. OK, so this change should update irq_thread(). But what else can fail? And what if another kthread uses task_work_add(current) to add the desctructor and does fput() without task_work_run() ? Oleg.