'\" t .\" Title: rpc_malloc .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: July 2017 .\" Manual: Linux Networking .\" Source: Kernel Hackers Manual 4.12.2 .\" Language: English .\" .TH "RPC_MALLOC" "9" "July 2017" "Kernel Hackers Manual 4\&.12\&" "Linux Networking" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" rpc_malloc \- allocate RPC buffer resources .SH "SYNOPSIS" .HP \w'int\ rpc_malloc('u .BI "int rpc_malloc(struct\ rpc_task\ *\ " "task" ");" .SH "ARGUMENTS" .PP \fIstruct rpc_task * task\fR .RS 4 RPC task .RE .SH "DESCRIPTION" .PP A single memory region is allocated, which is split between the RPC call and RPC reply that this task is being used for\&. When this RPC is retired, the memory is released by calling rpc_free\&. .PP To prevent rpciod from hanging, this allocator never sleeps, returning \-ENOMEM and suppressing warning if the request cannot be serviced immediately\&. The caller can arrange to sleep in a way that is safe for rpciod\&. .PP Most requests are \*(Aqsmall\*(Aq (under 2KiB) and can be serviced from a mempool, ensuring that NFS reads and writes can always proceed, and that there is good locality of reference for these buffers\&. .PP In order to avoid memory starvation triggering more writebacks of NFS requests, we avoid using GFP_KERNEL\&. .SH "COPYRIGHT" .br