Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp814924ybz; Fri, 1 May 2020 09:02:32 -0700 (PDT) X-Google-Smtp-Source: APiQypJM76wmHaA3N33pk65rV6MW2uvOcTtz9LLpAaJAfjoZiJKGB2fFLsQ/KYxrM1muY/05D0UT X-Received: by 2002:a17:906:2558:: with SMTP id j24mr4001288ejb.72.1588348952274; Fri, 01 May 2020 09:02:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588348952; cv=none; d=google.com; s=arc-20160816; b=UpfcJ0C9rlH6cDWFdgnBuBf57PoMFsDTjP6ZbT/GZn4ArIl9HSNNq7raRmV/sE51tf SMwzIsr2PXI94caO/qFgWtWBvkeDqaxsfA/a+F7pvIgHKKKkNsII/uODPBmaWC9WT05G vYyQLoLxdfbinUXFu7OOnxr6dnaq/pqPbVL1kpSEZ0T0yJdaIGODg9IgJlwAkpR+9nnW k3eNtrZb+6AIOYRfMJWHbrC/0DHSFg9WB/9ZtDAIXUd3IVqWmBQ1AKOXN0MY0o2c1EJg wVVUHGQbhiqRP+OSblkRCbfWUcJAE04KrbX+v9sWTyu4ydNZD3SBb4Cj+N1x1GElXvbv GTQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=8WKAt9tBIKcTuyf8UNOkAQ4L4hgpHSHebQQusGhKHb0=; b=sqbLbNsG+ISuJTDdgTVc1W5SFVcNPUCVBHl1ERPosSB4/s2wOjKmlL5BGt7Qykd2pP i73y3o7N1L1OCynr6DJCvB+g2Ce78Dy3dF4gnotNEsBs5Q+GdYLQPSxpC4Pzt4pX6hda JjfL7snSW/ZXe9nKUIK8EitS67pg2goirekMVSaKfz5pCFuZsoAcICEhilwXbes0cCB3 Ksbx92ppegg+nAUIF9PHjDOKsI8uSH8Sn+qJxw9qIRV9vBS+a0nCzJMCuSMO5PRaXu9D eGtRPz6aee8dcgWQZViudWvC/9/RDQj+jBsv3lHtkVzbJgnSyH7P2n1mdJl0oTXGxo2U kTaA== 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; dmarc=fail (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 dd8si2119035ejb.486.2020.05.01.09.01.56; Fri, 01 May 2020 09:02: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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729881AbgEAQBy (ORCPT + 99 others); Fri, 1 May 2020 12:01:54 -0400 Received: from fieldses.org ([173.255.197.46]:40318 "EHLO fieldses.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728495AbgEAQBy (ORCPT ); Fri, 1 May 2020 12:01:54 -0400 Received: by fieldses.org (Postfix, from userid 2815) id D38A43158; Fri, 1 May 2020 12:01:53 -0400 (EDT) From: "J. Bruce Fields" To: Linus Torvalds Cc: linux-nfs@vger.kernel.org, Jeff Layton , David Howells , Tejun Heo , Shaohua Li , Oleg Nesterov , linux-kernel@vger.kernel.org, "J. Bruce Fields" Subject: [PATCH 0/4] allow multiple kthreadd's Date: Fri, 1 May 2020 12:01:48 -0400 Message-Id: <1588348912-24781-1-git-send-email-bfields@redhat.com> X-Mailer: git-send-email 1.8.3.1 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: "J. Bruce Fields" These patches allow a caller to create its own kthreadd. The motivation is file delegations: currently any write operation from a client breaks all delegations, even delegations held by the same client. To fix that, we need to know which client is performing a given operation. So, we let nfsd put all the nfsd threads into the same thread group (by spawning them from its own private kthreadd), then patch the delegation code to treat delegation breaks from the same thread group as not conflicting, and then leave it to nfsd to sort out conflicts among its own clients. Those patches are in: git://linux-nfs.org/~bfields/linux.git deleg-fix-self-conflicts This was an idea from Trond. Part of his motivation was that it could work for userspace servers (like Ganesha and Samba) as well. (We don't currently let them request delegations, but probably will some day--it shouldn't be difficult.) Previously I considered instead adding a new field somewhere in the struct task. That might require a new system call to expose to user space. Or we might be able to put this in a keyring, if David Howells thought that would work. Before that I tried passing the identity of the breaker explicitly, but that looks like it would require passing the new argument around to huge swaths of the VFS. Anyway, does this multiple kthreadd approach look reasonable? (If so, who should handle the patches?) --b. J. Bruce Fields (4): kthreads: minor kthreadd refactoring kthreads: Simplify tsk_fork_get_node kthreads: allow multiple kthreadd's kthreads: allow cloning threads with different flags include/linux/kthread.h | 21 +++++- init/init_task.c | 3 + init/main.c | 4 +- kernel/fork.c | 4 ++ kernel/kthread.c | 140 +++++++++++++++++++++++++++++----------- 5 files changed, 132 insertions(+), 40 deletions(-) -- 2.26.2