<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/include/linux/sunrpc/svc.h, branch v4.4.93</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>nfsd/sunrpc: factor svc_rqst allocation and freeing from sv_nrthreads refcounting</title>
<updated>2015-08-10T20:05:44+00:00</updated>
<author>
<name>Jeff Layton</name>
<email>jlayton@primarydata.com</email>
</author>
<published>2015-06-08T19:11:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=1b6dc1dffbb142de60eb65f6155276ac31ff5474'/>
<id>1b6dc1dffbb142de60eb65f6155276ac31ff5474</id>
<content type='text'>
In later patches, we'll want to be able to allocate and free svc_rqst
structures without monkeying with the serv-&gt;sv_nrthreads refcount.

Factor those pieces out of their respective functions.

Signed-off-by: Shirley Ma &lt;shirley.ma@oracle.com&gt;
Acked-by: Jeff Layton &lt;jlayton@primarydata.com&gt;
Tested-by: Shirley Ma &lt;shirley.ma@oracle.com&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In later patches, we'll want to be able to allocate and free svc_rqst
structures without monkeying with the serv-&gt;sv_nrthreads refcount.

Factor those pieces out of their respective functions.

Signed-off-by: Shirley Ma &lt;shirley.ma@oracle.com&gt;
Acked-by: Jeff Layton &lt;jlayton@primarydata.com&gt;
Tested-by: Shirley Ma &lt;shirley.ma@oracle.com&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>nfsd/sunrpc: move pool_mode definitions into svc.h</title>
<updated>2015-08-10T20:05:43+00:00</updated>
<author>
<name>Jeff Layton</name>
<email>jlayton@primarydata.com</email>
</author>
<published>2015-06-08T19:09:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=d70bc0c67c7aaf0d00084b2f91b44fe1a8ae4e15'/>
<id>d70bc0c67c7aaf0d00084b2f91b44fe1a8ae4e15</id>
<content type='text'>
In later patches, we're going to need to allow code external to svc.c
to figure out what pool_mode is in use. Move these definitions into
svc.h to prepare for that.

Also, make the svc_pool_map object available and exported so that other
modules can peek in there to get insight into what pool mode is in use.
Likewise, export svc_pool_map_get/put function to make it safe to do so.

Signed-off-by: Shirley Ma &lt;shirley.ma@oracle.com&gt;
Acked-by: Jeff Layton &lt;jlayton@primarydata.com&gt;
Tested-by: Shirley Ma &lt;shirley.ma@oracle.com&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In later patches, we're going to need to allow code external to svc.c
to figure out what pool_mode is in use. Move these definitions into
svc.h to prepare for that.

Also, make the svc_pool_map object available and exported so that other
modules can peek in there to get insight into what pool mode is in use.
Likewise, export svc_pool_map_get/put function to make it safe to do so.

Signed-off-by: Shirley Ma &lt;shirley.ma@oracle.com&gt;
Acked-by: Jeff Layton &lt;jlayton@primarydata.com&gt;
Tested-by: Shirley Ma &lt;shirley.ma@oracle.com&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>nfsd/sunrpc: abstract out svc_set_num_threads to sv_ops</title>
<updated>2015-08-10T20:05:43+00:00</updated>
<author>
<name>Jeff Layton</name>
<email>jlayton@primarydata.com</email>
</author>
<published>2015-06-08T19:08:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=598e2359090d393b01a8e10386dc3056ccfa47ae'/>
<id>598e2359090d393b01a8e10386dc3056ccfa47ae</id>
<content type='text'>
Add an operation that will do setup of the service. In the case of a
classic thread-based service that means starting up threads. In the case
of a workqueue-based service, the setup will do something different.

Signed-off-by: Shirley Ma &lt;shirley.ma@oracle.com&gt;
Acked-by: Jeff Layton &lt;jlayton@primarydata.com&gt;
Tested-by: Shirley Ma &lt;shirliey.ma@oracle.com&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add an operation that will do setup of the service. In the case of a
classic thread-based service that means starting up threads. In the case
of a workqueue-based service, the setup will do something different.

Signed-off-by: Shirley Ma &lt;shirley.ma@oracle.com&gt;
Acked-by: Jeff Layton &lt;jlayton@primarydata.com&gt;
Tested-by: Shirley Ma &lt;shirliey.ma@oracle.com&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>nfsd/sunrpc: turn enqueueing a svc_xprt into a svc_serv operation</title>
<updated>2015-08-10T20:05:42+00:00</updated>
<author>
<name>Jeff Layton</name>
<email>jlayton@primarydata.com</email>
</author>
<published>2015-06-08T19:06:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=b9e13cdfac70e38ade17b53810a36968c5842339'/>
<id>b9e13cdfac70e38ade17b53810a36968c5842339</id>
<content type='text'>
For now, all services use svc_xprt_do_enqueue, but once we add
workqueue-based service support, we'll need to do something different.

Signed-off-by: Shirley Ma &lt;shirley.ma@oracle.com&gt;
Acked-by: Jeff Layton &lt;jlayton@primarydata.com&gt;
Tested-by: Shirley Ma &lt;shirley.ma@oracle.com&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
For now, all services use svc_xprt_do_enqueue, but once we add
workqueue-based service support, we'll need to do something different.

Signed-off-by: Shirley Ma &lt;shirley.ma@oracle.com&gt;
Acked-by: Jeff Layton &lt;jlayton@primarydata.com&gt;
Tested-by: Shirley Ma &lt;shirley.ma@oracle.com&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>nfsd/sunrpc: move sv_module parm into sv_ops</title>
<updated>2015-08-10T20:05:41+00:00</updated>
<author>
<name>Jeff Layton</name>
<email>jlayton@primarydata.com</email>
</author>
<published>2015-06-08T19:05:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=758f62fff9ad630f05866a1dd6ae9453a7730c2e'/>
<id>758f62fff9ad630f05866a1dd6ae9453a7730c2e</id>
<content type='text'>
...not technically an operation, but it's more convenient and cleaner
to pass the module pointer in this struct.

Signed-off-by: Shirley Ma &lt;shirley.ma@oracle.com&gt;
Acked-by: Jeff Layton &lt;jlayton@primarydata.com&gt;
Tested-by: Shirley Ma &lt;shirley.ma@oracle.com&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
...not technically an operation, but it's more convenient and cleaner
to pass the module pointer in this struct.

Signed-off-by: Shirley Ma &lt;shirley.ma@oracle.com&gt;
Acked-by: Jeff Layton &lt;jlayton@primarydata.com&gt;
Tested-by: Shirley Ma &lt;shirley.ma@oracle.com&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>nfsd/sunrpc: move sv_function into sv_ops</title>
<updated>2015-08-10T20:05:41+00:00</updated>
<author>
<name>Jeff Layton</name>
<email>jlayton@primarydata.com</email>
</author>
<published>2015-06-08T19:04:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=c369014f1776367269c8fbb5ea8932826d89ce2f'/>
<id>c369014f1776367269c8fbb5ea8932826d89ce2f</id>
<content type='text'>
Since we now have a container for holding svc_serv operations, move the
sv_function into it as well.

Signed-off-by: Shirley Ma &lt;shirley.ma@oracle.com&gt;
Acked-by: Jeff Layton &lt;jlayton@primarydata.com&gt;
Tested-by: Shirley Ma &lt;shirley.ma@oracle.com&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Since we now have a container for holding svc_serv operations, move the
sv_function into it as well.

Signed-off-by: Shirley Ma &lt;shirley.ma@oracle.com&gt;
Acked-by: Jeff Layton &lt;jlayton@primarydata.com&gt;
Tested-by: Shirley Ma &lt;shirley.ma@oracle.com&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>nfsd/sunrpc: add a new svc_serv_ops struct and move sv_shutdown into it</title>
<updated>2015-08-10T20:05:40+00:00</updated>
<author>
<name>Jeff Layton</name>
<email>jlayton@primarydata.com</email>
</author>
<published>2015-06-08T19:03:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=ea126e74353453d15fc0a181910ae1e25162f2a1'/>
<id>ea126e74353453d15fc0a181910ae1e25162f2a1</id>
<content type='text'>
In later patches we'll need to abstract out more operations on a
per-service level, besides sv_shutdown and sv_function.

Declare a new svc_serv_ops struct to hold these operations, and move
sv_shutdown into this struct.

Signed-off-by: Shirley Ma &lt;shirley.ma@oracle.com&gt;
Acked-by: Jeff Layton &lt;jlayton@primarydata.com&gt;
Tested-by: Shirley Ma &lt;shirley.ma@oracle.com&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In later patches we'll need to abstract out more operations on a
per-service level, besides sv_shutdown and sv_function.

Declare a new svc_serv_ops struct to hold these operations, and move
sv_shutdown into this struct.

Signed-off-by: Shirley Ma &lt;shirley.ma@oracle.com&gt;
Acked-by: Jeff Layton &lt;jlayton@primarydata.com&gt;
Tested-by: Shirley Ma &lt;shirley.ma@oracle.com&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>sunrpc/lockd: fix references to the BKL</title>
<updated>2015-01-23T15:29:12+00:00</updated>
<author>
<name>Jeff Layton</name>
<email>jeff.layton@primarydata.com</email>
</author>
<published>2015-01-22T13:19:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=3c5199143bc4b35f472c5c2534026d74821e2044'/>
<id>3c5199143bc4b35f472c5c2534026d74821e2044</id>
<content type='text'>
The BKL is completely out of the picture in the lockd and sunrpc code
these days. Update the antiquated comments that refer to it.

Signed-off-by: Jeff Layton &lt;jlayton@primarydata.com&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The BKL is completely out of the picture in the lockd and sunrpc code
these days. Update the antiquated comments that refer to it.

Signed-off-by: Jeff Layton &lt;jlayton@primarydata.com&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>sunrpc: convert to lockless lookup of queued server threads</title>
<updated>2014-12-09T16:22:22+00:00</updated>
<author>
<name>Jeff Layton</name>
<email>jlayton@primarydata.com</email>
</author>
<published>2014-11-21T19:19:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=b1691bc03d4eddb959234409167bef9be9e62d74'/>
<id>b1691bc03d4eddb959234409167bef9be9e62d74</id>
<content type='text'>
Testing has shown that the pool-&gt;sp_lock can be a bottleneck on a busy
server. Every time data is received on a socket, the server must take
that lock in order to dequeue a thread from the sp_threads list.

Address this problem by eliminating the sp_threads list (which contains
threads that are currently idle) and replacing it with a RQ_BUSY flag in
svc_rqst. This allows us to walk the sp_all_threads list under the
rcu_read_lock and find a suitable thread for the xprt by doing a
test_and_set_bit.

Note that we do still have a potential atomicity problem however with
this approach.  We don't want svc_xprt_do_enqueue to set the
rqst-&gt;rq_xprt pointer unless a test_and_set_bit of RQ_BUSY returned
zero (which indicates that the thread was idle). But, by the time we
check that, the bit could be flipped by a waking thread.

To address this, we acquire a new per-rqst spinlock (rq_lock) and take
that before doing the test_and_set_bit. If that returns false, then we
can set rq_xprt and drop the spinlock. Then, when the thread wakes up,
it must set the bit under the same spinlock and can trust that if it was
already set then the rq_xprt is also properly set.

With this scheme, the case where we have an idle thread no longer needs
to take the highly contended pool-&gt;sp_lock at all, and that removes the
bottleneck.

That still leaves one issue: What of the case where we walk the whole
sp_all_threads list and don't find an idle thread? Because the search is
lockess, it's possible for the queueing to race with a thread that is
going to sleep. To address that, we queue the xprt and then search again.

If we find an idle thread at that point, we can't attach the xprt to it
directly since that might race with a different thread waking up and
finding it.  All we can do is wake the idle thread back up and let it
attempt to find the now-queued xprt.

Signed-off-by: Jeff Layton &lt;jlayton@primarydata.com&gt;
Tested-by: Chris Worley &lt;chris.worley@primarydata.com&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Testing has shown that the pool-&gt;sp_lock can be a bottleneck on a busy
server. Every time data is received on a socket, the server must take
that lock in order to dequeue a thread from the sp_threads list.

Address this problem by eliminating the sp_threads list (which contains
threads that are currently idle) and replacing it with a RQ_BUSY flag in
svc_rqst. This allows us to walk the sp_all_threads list under the
rcu_read_lock and find a suitable thread for the xprt by doing a
test_and_set_bit.

Note that we do still have a potential atomicity problem however with
this approach.  We don't want svc_xprt_do_enqueue to set the
rqst-&gt;rq_xprt pointer unless a test_and_set_bit of RQ_BUSY returned
zero (which indicates that the thread was idle). But, by the time we
check that, the bit could be flipped by a waking thread.

To address this, we acquire a new per-rqst spinlock (rq_lock) and take
that before doing the test_and_set_bit. If that returns false, then we
can set rq_xprt and drop the spinlock. Then, when the thread wakes up,
it must set the bit under the same spinlock and can trust that if it was
already set then the rq_xprt is also properly set.

With this scheme, the case where we have an idle thread no longer needs
to take the highly contended pool-&gt;sp_lock at all, and that removes the
bottleneck.

That still leaves one issue: What of the case where we walk the whole
sp_all_threads list and don't find an idle thread? Because the search is
lockess, it's possible for the queueing to race with a thread that is
going to sleep. To address that, we queue the xprt and then search again.

If we find an idle thread at that point, we can't attach the xprt to it
directly since that might race with a different thread waking up and
finding it.  All we can do is wake the idle thread back up and let it
attempt to find the now-queued xprt.

Signed-off-by: Jeff Layton &lt;jlayton@primarydata.com&gt;
Tested-by: Chris Worley &lt;chris.worley@primarydata.com&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>sunrpc: fix potential races in pool_stats collection</title>
<updated>2014-12-09T16:22:22+00:00</updated>
<author>
<name>Jeff Layton</name>
<email>jlayton@primarydata.com</email>
</author>
<published>2014-11-21T19:19:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=403c7b44441d60aba7f8a134c31279ffa60ea769'/>
<id>403c7b44441d60aba7f8a134c31279ffa60ea769</id>
<content type='text'>
In a later patch, we'll be removing some spinlocking around the socket
and thread queueing code in order to fix some contention problems. At
that point, the stats counters will no longer be protected by the
sp_lock.

Change the counters to atomic_long_t fields, except for the
"sockets_queued" counter which will still be manipulated under a
spinlock.

Signed-off-by: Jeff Layton &lt;jlayton@primarydata.com&gt;
Tested-by: Chris Worley &lt;chris.worley@primarydata.com&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In a later patch, we'll be removing some spinlocking around the socket
and thread queueing code in order to fix some contention problems. At
that point, the stats counters will no longer be protected by the
sp_lock.

Change the counters to atomic_long_t fields, except for the
"sockets_queued" counter which will still be manipulated under a
spinlock.

Signed-off-by: Jeff Layton &lt;jlayton@primarydata.com&gt;
Tested-by: Chris Worley &lt;chris.worley@primarydata.com&gt;
Signed-off-by: J. Bruce Fields &lt;bfields@redhat.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
