<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/net/sunrpc/sched.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-04-07T20:20:00Z</updated>
<entry>
<title>SUNRPC: Handle allocation failure in rpc_new_task()</title>
<updated>2022-04-07T20:20:00Z</updated>
<author>
<name>Trond Myklebust</name>
</author>
<published>2022-04-07T02:36:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=25cf32ad5dba79385f6e7de9008dcb75556c42d2'/>
<id>urn:sha1:25cf32ad5dba79385f6e7de9008dcb75556c42d2</id>
<content type='text'>
If the call to rpc_alloc_task() fails, then ensure that the calldata is
released, and that rpc_run_task() and rpc_run_bc_task() bail out early.

Reported-by: NeilBrown &lt;neilb@suse.de&gt;
Fixes: 910ad38697d9 ("NFS: Fix memory allocation in rpc_alloc_task()")
Signed-off-by: Trond Myklebust &lt;trond.myklebust@hammerspace.com&gt;
</content>
</entry>
<entry>
<title>NFS: Fix memory allocation in rpc_alloc_task()</title>
<updated>2022-03-22T19:52:55Z</updated>
<author>
<name>Trond Myklebust</name>
</author>
<published>2022-03-21T21:37:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=910ad38697d95bd32f45ba70fd6952f6c2956f28'/>
<id>urn:sha1:910ad38697d95bd32f45ba70fd6952f6c2956f28</id>
<content type='text'>
As for rpc_malloc(), we first try allocating from the slab, then fall
back to a non-waiting allocation from the mempool.

Signed-off-by: Trond Myklebust &lt;trond.myklebust@hammerspace.com&gt;
</content>
</entry>
<entry>
<title>NFS: Fix memory allocation in rpc_malloc()</title>
<updated>2022-03-22T19:52:55Z</updated>
<author>
<name>Trond Myklebust</name>
</author>
<published>2022-03-15T02:02:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=33e5c765bc1ea5e06ea7603637f14d727e6fcdf3'/>
<id>urn:sha1:33e5c765bc1ea5e06ea7603637f14d727e6fcdf3</id>
<content type='text'>
When in a low memory situation, we do want rpciod to kick off direct
reclaim in the case where that helps, however we don't want it looping
forever in mempool_alloc().
So first try allocating from the slab using GFP_KERNEL | __GFP_NORETRY,
and then fall back to a GFP_NOWAIT allocation from the mempool.

Ditto for rpc_alloc_task()

Signed-off-by: Trond Myklebust &lt;trond.myklebust@hammerspace.com&gt;
</content>
</entry>
<entry>
<title>SUNRPC: improve 'swap' handling: scheduling and PF_MEMALLOC</title>
<updated>2022-03-13T16:59:35Z</updated>
<author>
<name>NeilBrown</name>
</author>
<published>2022-03-06T23:41:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8db55a032ac7ac1ed7b98d6b1dc980e6378c652f'/>
<id>urn:sha1:8db55a032ac7ac1ed7b98d6b1dc980e6378c652f</id>
<content type='text'>
rpc tasks can be marked as RPC_TASK_SWAPPER.  This causes GFP_MEMALLOC
to be used for some allocations.  This is needed in some cases, but not
in all where it is currently provided, and in some where it isn't
provided.

Currently *all* tasks associated with a rpc_client on which swap is
enabled get the flag and hence some GFP_MEMALLOC support.

GFP_MEMALLOC is provided for -&gt;buf_alloc() but only swap-writes need it.
However xdr_alloc_bvec does not get GFP_MEMALLOC - though it often does
need it.

xdr_alloc_bvec is called while the XPRT_LOCK is held.  If this blocks,
then it blocks all other queued tasks.  So this allocation needs
GFP_MEMALLOC for *all* requests, not just writes, when the xprt is used
for any swap writes.

Similarly, if the transport is not connected, that will block all
requests including swap writes, so memory allocations should get
GFP_MEMALLOC if swap writes are possible.

So with this patch:
 1/ we ONLY set RPC_TASK_SWAPPER for swap writes.
 2/ __rpc_execute() sets PF_MEMALLOC while handling any task
    with RPC_TASK_SWAPPER set, or when handling any task that
    holds the XPRT_LOCKED lock on an xprt used for swap.
    This removes the need for the RPC_IS_SWAPPER() test
    in -&gt;buf_alloc handlers.
 3/ xprt_prepare_transmit() sets PF_MEMALLOC after locking
    any task to a swapper xprt.  __rpc_execute() will clear it.
 3/ PF_MEMALLOC is set for all the connect workers.

Reviewed-by: Chuck Lever &lt;chuck.lever@oracle.com&gt; (for xprtrdma parts)
Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
Signed-off-by: Trond Myklebust &lt;trond.myklebust@hammerspace.com&gt;
</content>
</entry>
<entry>
<title>SUNRPC: remove scheduling boost for "SWAPPER" tasks.</title>
<updated>2022-03-13T16:59:35Z</updated>
<author>
<name>NeilBrown</name>
</author>
<published>2022-03-06T23:41:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a80a8461868905823609be97f91776a26befe839'/>
<id>urn:sha1:a80a8461868905823609be97f91776a26befe839</id>
<content type='text'>
Currently, tasks marked as "swapper" tasks get put to the front of
non-priority rpc_queues, and are sorted earlier than non-swapper tasks on
the transport's -&gt;xmit_queue.

This is pointless as currently *all* tasks for a mount that has swap
enabled on *any* file are marked as "swapper" tasks.  So the net result
is that the non-priority rpc_queues are reverse-ordered (LIFO).

This scheduling boost is not necessary to avoid deadlocks, and hurts
fairness, so remove it.  If there were a need to expedite some requests,
the tk_priority mechanism is a more appropriate tool.

Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
Signed-off-by: Trond Myklebust &lt;trond.myklebust@hammerspace.com&gt;
</content>
</entry>
<entry>
<title>SUNRPC/call_alloc: async tasks mustn't block waiting for memory</title>
<updated>2022-03-13T16:59:35Z</updated>
<author>
<name>NeilBrown</name>
</author>
<published>2022-03-06T23:41:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c487216bec83b0c5a8803e5c61433d33ad7b104d'/>
<id>urn:sha1:c487216bec83b0c5a8803e5c61433d33ad7b104d</id>
<content type='text'>
When memory is short, new worker threads cannot be created and we depend
on the minimum one rpciod thread to be able to handle everything.
So it must not block waiting for memory.

mempools are particularly a problem as memory can only be released back
to the mempool by an async rpc task running.  If all available
workqueue threads are waiting on the mempool, no thread is available to
return anything.

rpc_malloc() can block, and this might cause deadlocks.
So check RPC_IS_ASYNC(), rather than RPC_IS_SWAPPER() to determine if
blocking is acceptable.

Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
Signed-off-by: Trond Myklebust &lt;trond.myklebust@hammerspace.com&gt;
</content>
</entry>
<entry>
<title>SUNRPC: Convert GFP_NOFS to GFP_KERNEL</title>
<updated>2022-02-25T23:50:12Z</updated>
<author>
<name>Trond Myklebust</name>
</author>
<published>2022-01-29T17:49:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0adc87940618648b3dcccc819c20068bd6b4ec93'/>
<id>urn:sha1:0adc87940618648b3dcccc819c20068bd6b4ec93</id>
<content type='text'>
The sections which should not re-enter the filesystem are already
protected with memalloc_nofs_save/restore calls, so it is better to use
GFP_KERNEL in these calls to allow better performance for synchronous
RPC calls.

Signed-off-by: Trond Myklebust &lt;trond.myklebust@hammerspace.com&gt;
</content>
</entry>
<entry>
<title>SUNRPC: Trace calls to .rpc_call_done</title>
<updated>2021-10-20T22:09:54Z</updated>
<author>
<name>Chuck Lever</name>
</author>
<published>2021-10-16T22:02:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b40887e10dcacc5e8ae3c1a99dcba20877c4831b'/>
<id>urn:sha1:b40887e10dcacc5e8ae3c1a99dcba20877c4831b</id>
<content type='text'>
Introduce a single tracepoint that can replace simple dprintk call
sites in upper layer "rpc_call_done" callbacks. Example:

   kworker/u24:2-1254  [001]   771.026677: rpc_stats_latency:    task:00000001@00000002 xid=0x16a6f3c0 rpcbindv2 GETPORT backlog=446 rtt=101 execute=555
   kworker/u24:2-1254  [001]   771.026677: rpc_task_call_done:   task:00000001@00000002 flags=ASYNC|DYNAMIC|SOFT|SOFTCONN|SENT runstate=RUNNING|ACTIVE status=0 action=rpcb_getport_done
   kworker/u24:2-1254  [001]   771.026678: rpcb_setport:         task:00000001@00000002 status=0 port=20048

Signed-off-by: Chuck Lever &lt;chuck.lever@oracle.com&gt;
Signed-off-by: Trond Myklebust &lt;trond.myklebust@hammerspace.com&gt;
</content>
</entry>
<entry>
<title>SUNRPC: Per-rpc_clnt task PIDs</title>
<updated>2021-10-10T09:05:54Z</updated>
<author>
<name>Chuck Lever</name>
</author>
<published>2021-10-04T14:10:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0392dd51f9c78d46109a408f27dc820300dcd8bd'/>
<id>urn:sha1:0392dd51f9c78d46109a408f27dc820300dcd8bd</id>
<content type='text'>
The current range of RPC task PIDs is 0..65535. That's not adequate
for distinguishing tasks across multiple rpc_clnts running high
throughput workloads.

To help relieve this situation and to reduce the bottleneck of
having a single atomic for assigning all RPC task PIDs, assign task
PIDs per rpc_clnt.

Signed-off-by: Chuck Lever &lt;chuck.lever@oracle.com&gt;
Signed-off-by: Trond Myklebust &lt;trond.myklebust@hammerspace.com&gt;
</content>
</entry>
<entry>
<title>SUNRPC: Remove WQ_HIGHPRI from xprtiod</title>
<updated>2021-10-04T00:49:05Z</updated>
<author>
<name>Trond Myklebust</name>
</author>
<published>2021-07-12T15:57:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6dbcbe3f78bec62a4a96ac9cfddaf894a140b821'/>
<id>urn:sha1:6dbcbe3f78bec62a4a96ac9cfddaf894a140b821</id>
<content type='text'>
Don't let xprtiod pre-empt softirq.

Signed-off-by: Trond Myklebust &lt;trond.myklebust@hammerspace.com&gt;
</content>
</entry>
</feed>
