Re: [PATCH 2/8] mm/swap: fix race on swap_info reuse between swapoff and swapon

2014-02-03 Thread Hugh Dickins
On Mon, 3 Feb 2014, Andrew Morton wrote: > On Mon, 3 Feb 2014 15:23:40 -0800 Andrew Morton > wrote: > > On Mon, 27 Jan 2014 18:03:04 +0800 Weijie Yang > > wrote: > > > > > swapoff clear swap_info's SWP_USED flag prematurely and free its resources > > > after that. A concurrent swapon will reus

Re: [PATCH 2/8] mm/swap: fix race on swap_info reuse between swapoff and swapon

2014-02-03 Thread Andrew Morton
On Mon, 3 Feb 2014 15:23:40 -0800 Andrew Morton wrote: > On Mon, 27 Jan 2014 18:03:04 +0800 Weijie Yang > wrote: > > > swapoff clear swap_info's SWP_USED flag prematurely and free its resources > > after that. A concurrent swapon will reuse this swap_info while its previous > > resources are

Re: [PATCH 2/8] mm/swap: fix race on swap_info reuse between swapoff and swapon

2014-02-03 Thread Andrew Morton
On Mon, 27 Jan 2014 18:03:04 +0800 Weijie Yang wrote: > swapoff clear swap_info's SWP_USED flag prematurely and free its resources > after that. A concurrent swapon will reuse this swap_info while its previous > resources are not cleared completely. > > These late freed resources are: > - p->pe

[PATCH 2/8] mm/swap: fix race on swap_info reuse between swapoff and swapon

2014-01-27 Thread Weijie Yang
swapoff clear swap_info's SWP_USED flag prematurely and free its resources after that. A concurrent swapon will reuse this swap_info while its previous resources are not cleared completely. These late freed resources are: - p->percpu_cluster - swap_cgroup_ctrl[type] - block_device setting - in