'\" t .\" Title: rpc_malloc .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: January 2017 .\" Manual: Linux Networking .\" Source: Kernel Hackers Manual 4.8.15 .\" Language: English .\" .TH "RPC_MALLOC" "9" "January 2017" "Kernel Hackers Manual 4\&.8\&." "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 an RPC buffer .SH "SYNOPSIS" .HP \w'void\ *\ rpc_malloc('u .BI "void * rpc_malloc(struct\ rpc_task\ *\ " "task" ", size_t\ " "size" ");" .SH "ARGUMENTS" .PP \fItask\fR .RS 4 RPC task that will use this buffer .RE .PP \fIsize\fR .RS 4 requested byte size .RE .SH "DESCRIPTION" .PP To prevent rpciod from hanging, this allocator never sleeps, returning NULL 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