Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp36590885rwd; Tue, 11 Jul 2023 03:07:05 -0700 (PDT) X-Google-Smtp-Source: APBJJlGz2HVIY5Wy3PpUNXdONKQTWv+V+R/a2+16HFlYzbMkYRmrUqDTUezhE6oHqE1TPJYP2PMq X-Received: by 2002:a2e:9d16:0:b0:2b6:e958:5700 with SMTP id t22-20020a2e9d16000000b002b6e9585700mr6677737lji.4.1689070024868; Tue, 11 Jul 2023 03:07:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689070024; cv=none; d=google.com; s=arc-20160816; b=RHdYHxETBw4GJFBeQ9AWIOTtRwylphCHN0L58Tj1av0uNmpjlQTAboVbT5geo7xaI3 ZfgFp+iu6z9UgEDSyITXsOAaDm4Wq7M/CL5poFr40qyrsa0iBkvrJefqYc2puYfz0hWd gPdIA1peA0m+HsVuyZXpu4lDk/EPfb/s5OWCNjOyg1Ov4166bKpKR5RzGFaE1EOrWYHY Sfj8MTGQWfLVJasveALapmFbBqKKiSD8Wl52i/gIBdpn958ZbNX2wuQpZi2X7jSlsEmW JyhuOjpfsKyUTVSnJLbywgb6LxIPYMquAy3/K9frSbrrJDRWQFWIPOr1bWrwGXk3RTMq xzsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:references:in-reply-to:subject :cc:to:from:mime-version:content-transfer-encoding:dkim-signature :dkim-signature; bh=OHLe19ORc2k9oKi4XEu51yYkED1JcEyZpQf1Fkd6EF4=; fh=Yjgs+yt7oflifVRM1bK11aB9HF4NZ0yPUmbEuCnbH6w=; b=K9in3OBNuoXq0Ivy7KtghfaqHEaLbdasOsW/XG3cn7GsDDG+53Q5PZCJFRl25LSjrD C8qyMxi3nu9743fBpGV6+0XzP0Wjr2OXRR74BBkd+X7lV3hBgFGIr/zziBexy5w3zGTa BSyATmaKpA7k+TYrE/t4V13zZSe7dX/wXHRJEk+iaRtlqFCcmit3EspahBDcEmzRmYUb Xo8m95tTsUUSoBWbOF/Z+jM9PAvuvtMU6Se+UUKnUYNcL7Lpi+peYcxelsOWvkVCAl9M 1SKN2V6VEV+R4XD2MqAy8+iHjcGVcLzLKYsvnnLS3CHDm+JkaWI9maRNDiVtJ4lrVyx/ KoBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=SuVCP4gJ; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=uMLJEOAa; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f21-20020a1709062c5500b0099360544774si1625318ejh.614.2023.07.11.03.06.32; Tue, 11 Jul 2023 03:07:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=SuVCP4gJ; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=uMLJEOAa; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229548AbjGKKBu (ORCPT + 99 others); Tue, 11 Jul 2023 06:01:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44888 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229503AbjGKKBt (ORCPT ); Tue, 11 Jul 2023 06:01:49 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 38168A9 for ; Tue, 11 Jul 2023 03:01:48 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id EFC24204E9; Tue, 11 Jul 2023 10:01:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1689069706; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OHLe19ORc2k9oKi4XEu51yYkED1JcEyZpQf1Fkd6EF4=; b=SuVCP4gJjey7MXjBL+iZKeSZDfgKVIGyXQ6wzp+P/SEcTSZInAq1OEuDq1umrjUmzYiXSC nriQax8Os4/JBEBq1pcGifYgBCEQx9+t0Ln/VTk8xt+0Nx5HCsPTlJAkfJfE8HcrkZz42X BnDTujKwDoZYS7WbPFC167kQOfwFL7g= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1689069706; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OHLe19ORc2k9oKi4XEu51yYkED1JcEyZpQf1Fkd6EF4=; b=uMLJEOAa5ZmkKFRTfj5vVg+wb6n6+3egYrm9pwrjexaAf/+t6viAUXaGAXlUC2PkVvhvX3 mLwt+10c5iEIcOCw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id C0D3A1391C; Tue, 11 Jul 2023 10:01:44 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id sUySHIgorWS6awAAMHmgww (envelope-from ); Tue, 11 Jul 2023 10:01:44 +0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 From: "NeilBrown" To: "Chuck Lever III" Cc: "Chuck Lever" , "Linux NFS Mailing List" , "lorenzo@kernel.org" , "Jeff Layton" , "david@fromorbit.com" Subject: Re: [PATCH/RFC] sunrpc: constant-time code to wake idle thread In-reply-to: <2211CC3B-806F-461D-A5AA-E95E35E1E408@oracle.com> References: <168842897573.139194.15893960758088950748.stgit@manet.1015granger.net>, <168842927591.139194.16920372497489479670.stgit@manet.1015granger.net>, <168843152047.8939.5788535164524204707@noble.neil.brown.name>, , <168894969894.8939.6993305724636717703@noble.neil.brown.name>, , <168902749573.8939.3668770103738816387@noble.neil.brown.name>, <2211CC3B-806F-461D-A5AA-E95E35E1E408@oracle.com> Date: Tue, 11 Jul 2023 20:01:41 +1000 Message-id: <168906970156.8939.2877716074642019289@noble.neil.brown.name> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Tue, 11 Jul 2023, Chuck Lever III wrote: > > On Jul 10, 2023, at 6:18 PM, NeilBrown wrote: > > > > What do you think of removing the ability to stop an nfsd thread by > > sending it a signal. Note that this doesn't apply to lockd or to nfsv4 > > callback threads. And nfs-utils never relies on this. > > I'm keen. It would make this patch a lot simpler. > > I agree the code base would be cleaner for it. > > But I'm the new kid. I'm not really sure if this is > part of a kernel - user space API that we mustn't > alter, or whether it's something that was added but > never used, or .... > > I can sniff around to get a better understanding. Once upon a time it was the only way to kill the threads. There was a syscall which let you start some threads. You couldn't change the number of threads, but you could kill them. And shutdown always kills processes, so letting nfsd threads be killed meant that would be removed at system shutdown. When I added the ability to dynamically change the number of threads it made sense that we could set the number to zero, and then to use that functionality to shut down the nfs server. So the /etc/init.d/nfsd script changed from "killall -9 nfsd" or whatever it was to "rpc.nfsd 0". But it didn't seem sensible to remove the "kill" functionality until after a transition process, and I never thought the schedule a formal deprecation. So it just stayed... The more I think about it, the more I am in favour of removing it. I don't think any other kernel threads can be killed. nfsd doesn't need to be special. Maybe I'll post a patch which just does that. NeilBrown