Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp905375ybj; Tue, 5 May 2020 09:24:32 -0700 (PDT) X-Google-Smtp-Source: APiQypLt9DMMN0rk9Ro/4IeVOFv6/hi5GVjQliAKKfPOrNKxQssEwq0Qi4xPZbzuSVtPdkJwqa+9 X-Received: by 2002:aa7:d894:: with SMTP id u20mr3169097edq.205.1588695872351; Tue, 05 May 2020 09:24:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588695872; cv=none; d=google.com; s=arc-20160816; b=kF7FRQh8cvcnwXKHjR4SgsK3+0hrAZmTGAW2orpeMJrqq/XzGXQTCBlnRruTrPoch1 j29BWFRK4XTL9rowzEiKNfEEiHOA1HXjwRsInQO6bVhHQyqz3Rz628cbNPFa8zUX/dsB mywDDH+0A3I2OcEkNswTGM1J3XTT2JzxuyNo5LsEn6WwdiasQl8VaAkIXVRFTvH3KsXZ DEz46J0HeAFwr+goXQWabraA7jt1k25n8np0mHGrpP4B4h6Tkh1LQVfeKHlrOvqaxGcm F8g/GKD8BTm41gXWufVbC9eGl3NFWb1U6N93uSbAe8YifNpNADErX6FZbnmh9e04sy79 8jFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:from:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:date; bh=FZEeGQeHrPxTOBALLtmcbCR4G1NV6oYQGDBt6h1699s=; b=Xrzo3masLGiXJKjdtp84bPxcfhTzNu5Xd0U26nMqw2GWB/Vz+FhPkUx8xI3DUKtl3N ylBUbdLj3kgjFxJKkuELXMCWsciL8S8ILR1EwJhMib1v5FKVT/wKI8TzGFOyMWMB6s71 amKs2PxW9dcia8PiAqSVi6If/pCR/NY4CkXYEBUm1vHOFUPeOMByn0fR+5xioeXuw91y ZWlsqasfBJ91vEAiLKX1XCsDdnfcqk4+8aw4t0N/46pbWQ4CXrv4K4M/0QK7zDyajHaK 7TjOcBD+Ph+qAslrQtryTXDFRvOSkhDAk/aqoWppYEFRSDAF29PabdRd0D+ynDli/vVS UdjA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l19si1328491ejq.122.2020.05.05.09.23.58; Tue, 05 May 2020 09:24:32 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729604AbgEEQXy (ORCPT + 99 others); Tue, 5 May 2020 12:23:54 -0400 Received: from fieldses.org ([173.255.197.46]:46768 "EHLO fieldses.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728807AbgEEQXy (ORCPT ); Tue, 5 May 2020 12:23:54 -0400 Received: by fieldses.org (Postfix, from userid 2815) id E8E7A5A30; Tue, 5 May 2020 12:23:53 -0400 (EDT) Date: Tue, 5 May 2020 12:23:53 -0400 To: Tejun Heo Cc: "J. Bruce Fields" , Linus Torvalds , "open list:NFS, SUNRPC, AND..." , Jeff Layton , David Howells , Shaohua Li , Oleg Nesterov , Linux Kernel Mailing List Subject: Re: [PATCH 0/4] allow multiple kthreadd's Message-ID: <20200505162353.GA27966@fieldses.org> References: <1588348912-24781-1-git-send-email-bfields@redhat.com> <20200501182154.GG5462@mtj.thefacebook.com> <20200505021514.GA43625@pick.fieldses.org> <20200505155405.GD12217@mtj.thefacebook.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200505155405.GD12217@mtj.thefacebook.com> User-Agent: Mutt/1.5.21 (2010-09-15) From: bfields@fieldses.org (J. Bruce Fields) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Tue, May 05, 2020 at 11:54:05AM -0400, Tejun Heo wrote: > Hello, Bruce. > > On Mon, May 04, 2020 at 10:15:14PM -0400, J. Bruce Fields wrote: > > We're currently using it to pass the struct svc_rqst that a new nfsd > > thread needs. But once the new thread has gotten that, I guess it could > > set kthread->data to some global value that it uses to say "I'm a knfsd > > thread"? > > > > I suppose that would work. > > > > Though now I'm feeling greedy: it would be nice to have both some kind > > of global flag, *and* keep kthread->data pointing to svc_rqst (as that > > would give me a simpler and quicker way to figure out which client is > > conflicting). Could I take a flag bit in kthread->flags, maybe? > > Hmm... that'd be solvable if kthread->data can point to a struct which does > both things, right? Isn't this some sort of chicken-and-egg problem? If you don't know whether a given kthread is an nfsd thread or not, then it's not safe to assume that kthread->data points to some nfsd-specific structure that might tell you whether it's an nfsd thread. > Because it doesn't have free() callback, it's a bit > awkward but the threadfn itself can unlink and RCU-free it before returning. It's only ever going to be referenced from the thread itself. This is just a way to ask "am I running as an nfsd thread?" when we're deep inside generic filesystem code somewhere. So I don't think there's any complicated lifetime issues here. --b.