<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/net/sunrpc/svc.c, branch linux-5.18.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.18.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.18.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2022-02-28T15:26:40Z</updated>
<entry>
<title>NFSD: Move svc_serv_ops::svo_function into struct svc_serv</title>
<updated>2022-02-28T15:26:40Z</updated>
<author>
<name>Chuck Lever</name>
</author>
<published>2022-02-16T17:16:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=37902c6313090235c847af89c5515591261ee338'/>
<id>urn:sha1:37902c6313090235c847af89c5515591261ee338</id>
<content type='text'>
Hoist svo_function back into svc_serv and remove struct
svc_serv_ops, since the struct is now devoid of fields.

Signed-off-by: Chuck Lever &lt;chuck.lever@oracle.com&gt;
</content>
</entry>
<entry>
<title>NFSD: Remove svc_serv_ops::svo_module</title>
<updated>2022-02-28T15:26:40Z</updated>
<author>
<name>Chuck Lever</name>
</author>
<published>2022-02-16T17:31:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f49169c97fceb21ad6a0aaf671c50b0f520f15a5'/>
<id>urn:sha1:f49169c97fceb21ad6a0aaf671c50b0f520f15a5</id>
<content type='text'>
struct svc_serv_ops is about to be removed.

Neil Brown says:
&gt; I suspect svo_module can go as well - I don't think the thread is
&gt; ever the thing that primarily keeps a module active.

A random sample of kthread_create() callers shows sunrpc is the only
one that manages module reference count in this way.

Suggested-by: Neil Brown &lt;neilb@suse.de&gt;
Signed-off-by: Chuck Lever &lt;chuck.lever@oracle.com&gt;
</content>
</entry>
<entry>
<title>SUNRPC: Remove svc_shutdown_net()</title>
<updated>2022-02-28T15:26:40Z</updated>
<author>
<name>Chuck Lever</name>
</author>
<published>2022-01-26T16:30:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c7d7ec8f043e53ad16e30f5ebb8b9df415ec0f2b'/>
<id>urn:sha1:c7d7ec8f043e53ad16e30f5ebb8b9df415ec0f2b</id>
<content type='text'>
Clean up: svc_shutdown_net() now does nothing but call
svc_close_net(). Replace all external call sites.

svc_close_net() is renamed to be the inverse of svc_xprt_create().

Signed-off-by: Chuck Lever &lt;chuck.lever@oracle.com&gt;
</content>
</entry>
<entry>
<title>SUNRPC: Rename svc_close_xprt()</title>
<updated>2022-02-28T15:26:40Z</updated>
<author>
<name>Chuck Lever</name>
</author>
<published>2022-01-31T18:34:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4355d767a21b9445958fc11bce9a9701f76529d3'/>
<id>urn:sha1:4355d767a21b9445958fc11bce9a9701f76529d3</id>
<content type='text'>
Clean up: Use the "svc_xprt_&lt;task&gt;" function naming convention as
is used for other external APIs.

Signed-off-by: Chuck Lever &lt;chuck.lever@oracle.com&gt;</content>
</entry>
<entry>
<title>SUNRPC: Remove svo_shutdown method</title>
<updated>2022-02-28T15:26:39Z</updated>
<author>
<name>Chuck Lever</name>
</author>
<published>2022-01-25T18:49:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=87cdd8641c8a1ec6afd2468265e20840a57fd888'/>
<id>urn:sha1:87cdd8641c8a1ec6afd2468265e20840a57fd888</id>
<content type='text'>
Clean up. Neil observed that "any code that calls svc_shutdown_net()
knows what the shutdown function should be, and so can call it
directly."

Signed-off-by: Chuck Lever &lt;chuck.lever@oracle.com&gt;
Reviewed-by: NeilBrown &lt;neilb@suse.de&gt;
</content>
</entry>
<entry>
<title>lockd: use svc_set_num_threads() for thread start and stop</title>
<updated>2021-12-13T18:42:58Z</updated>
<author>
<name>NeilBrown</name>
</author>
<published>2021-11-29T04:51:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6b044fbaab02292fedb17565dbb3f2528083b169'/>
<id>urn:sha1:6b044fbaab02292fedb17565dbb3f2528083b169</id>
<content type='text'>
svc_set_num_threads() does everything that lockd_start_svc() does, except
set sv_maxconn.  It also (when passed 0) finds the threads and
stops them with kthread_stop().

So move the setting for sv_maxconn, and use svc_set_num_thread()

We now don't need nlmsvc_task.

Now that we use svc_set_num_threads() it makes sense to set svo_module.
This request that the thread exists with module_put_and_exit().
Also fix the documentation for svo_module to make this explicit.

svc_prepare_thread is now only used where it is defined, so it can be
made static.

Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
Signed-off-by: Chuck Lever &lt;chuck.lever@oracle.com&gt;
</content>
</entry>
<entry>
<title>SUNRPC: always treat sv_nrpools==1 as "not pooled"</title>
<updated>2021-12-13T18:42:57Z</updated>
<author>
<name>NeilBrown</name>
</author>
<published>2021-11-29T04:51:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=93aa619eb0b42eec2f3a9b4d9db41f5095390aec'/>
<id>urn:sha1:93aa619eb0b42eec2f3a9b4d9db41f5095390aec</id>
<content type='text'>
Currently 'pooled' services hold a reference on the pool_map, and
'unpooled' services do not.
svc_destroy() uses the presence of -&gt;svo_function (via
svc_serv_is_pooled()) to determine if the reference should be dropped.
There is no direct correlation between being pooled and the use of
svo_function, though in practice, lockd is the only non-pooled service,
and the only one not to use svo_function.

This is untidy and would cause problems if we changed lockd to use
svc_set_num_threads(), which requires the use of -&gt;svo_function.

So change the test for "is the service pooled" to "is sv_nrpools &gt; 1".

This means that when svc_pool_map_get() returns 1, it must NOT take a
reference to the pool.

We discard svc_serv_is_pooled(), and test sv_nrpools directly.

Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
Signed-off-by: Chuck Lever &lt;chuck.lever@oracle.com&gt;
</content>
</entry>
<entry>
<title>SUNRPC: move the pool_map definitions (back) into svc.c</title>
<updated>2021-12-13T18:42:57Z</updated>
<author>
<name>NeilBrown</name>
</author>
<published>2021-11-29T04:51:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=cf0e124e0a489944d08fcc3c694d2b234d2cc658'/>
<id>urn:sha1:cf0e124e0a489944d08fcc3c694d2b234d2cc658</id>
<content type='text'>
These definitions are not used outside of svc.c, and there is no
evidence that they ever have been.  So move them into svc.c
and make the declarations 'static'.

Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
Signed-off-by: Chuck Lever &lt;chuck.lever@oracle.com&gt;
</content>
</entry>
<entry>
<title>SUNRPC: discard svo_setup and rename svc_set_num_threads_sync()</title>
<updated>2021-12-13T18:42:53Z</updated>
<author>
<name>NeilBrown</name>
</author>
<published>2021-11-29T04:51:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3ebdbe5203a874614819700d3f470724cb803709'/>
<id>urn:sha1:3ebdbe5203a874614819700d3f470724cb803709</id>
<content type='text'>
The -&gt;svo_setup callback serves no purpose.  It is always called from
within the same module that chooses which callback is needed.  So
discard it and call the relevant function directly.

Now that svc_set_num_threads() is no longer used remove it and rename
svc_set_num_threads_sync() to remove the "_sync" suffix.

Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
Signed-off-by: Chuck Lever &lt;chuck.lever@oracle.com&gt;
</content>
</entry>
<entry>
<title>SUNRPC: use sv_lock to protect updates to sv_nrthreads.</title>
<updated>2021-12-13T18:42:52Z</updated>
<author>
<name>NeilBrown</name>
</author>
<published>2021-11-29T04:51:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2a36395fac3b72771f87c3ee4387e3a96d85a7cc'/>
<id>urn:sha1:2a36395fac3b72771f87c3ee4387e3a96d85a7cc</id>
<content type='text'>
Using sv_lock means we don't need to hold the service mutex over these
updates.

In particular,  svc_exit_thread() no longer requires synchronisation, so
threads can exit asynchronously.

Note that we could use an atomic_t, but as there are many more read
sites than writes, that would add unnecessary noise to the code.
Some reads are already racy, and there is no need for them to not be.

Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
Signed-off-by: Chuck Lever &lt;chuck.lever@oracle.com&gt;
</content>
</entry>
</feed>
