Skip to content

Swap over NFS -v14

Peter Zijlstra linux-mm lkml netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest33 patches 38 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/33mm: gfp_to_alloc_flags()mm/internal.h mm/page_alloc.c+67 -420 replies
2/33mm: tag reseve pagesinclude/linux/mm_types.h mm/page_alloc.c+4 -10 replies
3/33mm: slub: add knowledge of reserve pagesinclude/linux/slub_def.h mm/slub.c+24 -87 replies
4/33mm: allow mempool to fall back to memalloc reservesmm/mempool.c+11 -11 reply
5/33mm: kmem_estimate_pages()include/linux/slab.h mm/slub.c+85 -02 replies
6/33mm: allow PF_MEMALLOC from softirq contextinclude/linux/sched.h kernel/softirq.c mm/page_alloc.c+11 -34 replies
7/33mm: serialize access to min_free_kbytesmm/page_alloc.c+13 -30 replies
8/33mm: emergency poolinclude/linux/mmzone.h mm/page_alloc.c mm/vmstat.c+78 -130 replies
9/33mm: system wide ALLOC_NO_WATERMARKmm/page_alloc.c+6 -02 replies
10/33mm: __GFP_MEMALLOCinclude/linux/gfp.h mm/page_alloc.c+5 -20 replies
11/33mm: memory reserve managementinclude/linux/reserve.h mm/Makefile mm/reserve.c+491 -10 replies
12/33selinux: tag avc cache alloc as non-criticalsecurity/selinux/avc.c+1 -10 replies
13/33net: wrap sk->sk_backlog_rcv()include/net/sock.h net/core/sock.c net/ipv4/tcp.c +1 more+9 -40 replies
14/33net: packet split receive apidrivers/net/e1000/e1000_main.c drivers/net/sky2.c include/linux/skbuff.h +1 more+51 -160 replies
15/33net: sk_allocation() - concentrate socket related allocationsinclude/net/sock.h net/ipv4/tcp_output.c net/ipv6/tcp_ipv6.c+21 -110 replies
16/33netvm: network reserve infrastructureinclude/net/sock.h net/Kconfig net/core/sock.c+150 -10 replies
17/33sysctl: propagate conv errorskernel/sysctl.c+6 -50 replies
18/33netvm: INET reserves.include/linux/sysctl.h kernel/sysctl.c net/ipv4/ip_fragment.c +5 more+136 -60 replies
19/33netvm: hook skb allocation to reservesinclude/linux/mm_types.h include/linux/skbuff.h net/core/skbuff.c+173 -260 replies
20/33netvm: filter emergency skbs.include/net/sock.h+3 -00 replies
21/33netvm: prevent a TCP specific deadlockinclude/net/sock.h net/core/stream.c+7 -50 replies
22/33netfilter: NF_QUEUE vs emergency skbsnet/netfilter/core.c+3 -00 replies
23/33netvm: skb processinginclude/net/sock.h net/core/dev.c net/core/sock.c+61 -63 replies
24/33mm: prepare swap entry methods for use in page methodsinclude/linux/mm.h include/linux/swap.h include/linux/swapops.h +1 more+57 -440 replies
25/33mm: add support for non block device backed swap filesDocumentation/filesystems/Locking include/linux/buffer_head.h include/linux/fs.h +5 more+101 -20 replies
26/33mm: methods for teaching filesystems about PG_swapcache pagesinclude/linux/mm.h include/linux/pagemap.h+27 -10 replies
27/33nfs: remove mempoolsfs/nfs/read.c fs/nfs/write.c+8 -340 replies
28/33nfs: teach the NFS client how to treat PG_swapcache pagesfs/nfs/file.c fs/nfs/internal.h fs/nfs/pagelist.c +2 more+39 -371 reply
29/33nfs: disable data cache revalidation for swapfilesfs/nfs/inode.c fs/nfs/write.c+65 -140 replies
30/33nfs: swap vs nfs_writepagefs/nfs/write.c+23 -00 replies
31/33nfs: enable swap on NFSfs/Kconfig fs/nfs/file.c include/linux/sunrpc/xprt.h +2 more+102 -30 replies
32/33nfs: fix various memory recursions possible with swap over NFS.fs/nfs/pagelist.c fs/nfs/write.c+4 -40 replies
33/33nfs: do not warn on radix tree node allocation failuresfs/nfs/inode.c fs/nfs/write.c+11 -10 replies

Reviews trailers per patch

1 of 33 patches has a Reviewed-by or Acked-by.

PatchJames Morris
1/33
2/33
3/33
4/33
5/33
6/33
7/33
8/33
9/33
10/33
11/33
12/33A-b
13/33
14/33
15/33
16/33
17/33
18/33
19/33
20/33
21/33
22/33
23/33
24/33
25/33
26/33
27/33
28/33
29/33
30/33
31/33
32/33
33/33

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 00/33] Swap over NFS -v14

Hi,

Another posting of the full swap over NFS series.

[ I tried just posting the first part last time around, but
that just gets more confusion by lack of a general picture ]

[ patches against 2.6.23-mm1, also to be found online at:
http://programming.kicks-ass.net/kernel-patches/vm_deadlock/v2.6.23-mm1/ ]

The patch-set can be split in roughtly 5 parts, for each of which I shall give a description.

Part 1, patches 1-12

The problem with swap over network is the generic swap problem: needing memory to free memory. Normally this is solved using mempools, as can be seen in the BIO layer.

Swap over network has the problem that the network subsystem does not use fixed sized allocations, but heavily relies on kmalloc(). This makes mempools unusable.

This first part provides a generic reserve framework.

Care is taken to only affect the slow paths - when we're low on memory.

Caveats: it is currently SLUB only.

1 - mm: gfp_to_alloc_flags()
2 - mm: tag reseve pages
3 - mm: slub: add knowledge of reserve pages
4 - mm: allow mempool to fall back to memalloc reserves 5 - mm: kmem_estimate_pages()
6 - mm: allow PF_MEMALLOC from softirq context 7 - mm: serialize access to min_free_kbytes
8 - mm: emergency pool
9 - mm: system wide ALLOC_NO_WATERMARK
10 - mm: __GFP_MEMALLOC
11 - mm: memory reserve management
12 - selinux: tag avc cache alloc as non-critical

Part 2, patches 13-15

Provide some generic network infrastructure needed later on.

13 - net: wrap sk->sk_backlog_rcv()
14 - net: packet split receive api
15 - net: sk_allocation() - concentrate socket related allocations

Part 3, patches 16-23

Now that we have a generic memory reserve system, use it on the network stack. The thing that makes this interesting is that, contrary to BIO, both the transmit and receive path require memory allocations.

That is, in the BIO layer write back completion is usually just an ISR flipping a bit and waking stuff up. A network write back completion involved receiving packets, which when there is no memory, is rather hard. And even when there is memory there is no guarantee that the required packet comes in in the window that that memory buys us.

The solution to this problem is found in the fact that network is to be assumed lossy. Even now, when there is no memory to receive packets the network card will have to discard packets. What we do is move this into the network stack.

So we reserve a little pool to act as a receive buffer, this allows us to inspect packets before tossing them. This way, we can filter out those packets that ensure progress (writeback completion) and disregard the others (as would have happened anyway). [ NOTE: this is a stable mode of operation with limited memory usage, exactly the kind of thing we need ]

Again, care is taken to keep much of the overhead of this to only affect the slow path. Only packets allocated from the reserves will suffer the extra atomic overhead needed for accounting.

16 - netvm: network reserve infrastructure
17 - sysctl: propagate conv errors
18 - netvm: INET reserves.
19 - netvm: hook skb allocation to reserves
20 - netvm: filter emergency skbs.
21 - netvm: prevent a TCP specific deadlock
22 - netfilter: NF_QUEUE vs emergency skbs
23 - netvm: skb processing

Part 4, patches 24-26

Generic vm infrastructure to handle swapping to a filesystem instead of a block device. The approach here has been questioned, people would like to see a less invasive approach.

One suggestion is to create and use a_ops->swap_{in,out}().

24 - mm: prepare swap entry methods for use in page methods 25 - mm: add support for non block device backed swap files 26 - mm: methods for teaching filesystems about PG_swapcache pages

Part 5, patches 27-33

Finally, convert NFS to make use of the new network and vm infrastructure to provide swap over NFS.

27 - nfs: remove mempools
28 - nfs: teach the NFS client how to treat PG_swapcache pages 29 - nfs: disable data cache revalidation for swapfiles 30 - nfs: swap vs nfs_writepage
31 - nfs: enable swap on NFS
32 - nfs: fix various memory recursions possible with swap over NFS. 33 - nfs: do not warn on radix tree node allocation failures

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>