Re: [Nbd] [PATCH 4/4] mtd: nand: nandsim: convert to memalloc_noreclaim_*()
- To: Adrian Hunter <adrian.hunter@...1303...>
- Cc: nbd-general@lists.sourceforge.net, Boris Brezillon <boris.brezillon@...1551...>, linux-scsi@...25..., Richard Weinberger <richard@...2889...>, linux-kernel@...25..., linux-block@...25..., linux-mm@...1312..., netdev@...25..., Johannes Weiner <hannes@...1554...>, Andrew Morton <akpm@...133...>, open-iscsi@...2887..., Mel Gorman <mgorman@...2888...>, Vlastimil Babka <vbabka@...1290...>
- Subject: Re: [Nbd] [PATCH 4/4] mtd: nand: nandsim: convert to memalloc_noreclaim_*()
- From: Michal Hocko <mhocko@...1285...>
- Date: Thu, 6 Apr 2017 09:27:55 +0200
- Message-id: <20170406072754.GC5497@...2894...>
- In-reply-to: <fe1c21a4-0bc6-529c-5446-382b01d4c99e@...1303...>
- References: <20170405074700.29871-1-vbabka@...1290...> <20170405074700.29871-5-vbabka@...1290...> <20170405113157.GM6035@...2894...> <ee6649ed-b0e8-1c59-c193-d1688fdfe7f5@...2889...> <9b9d5bca-e125-e07b-b700-196cc800bbd7@...1290...> <fe1c21a4-0bc6-529c-5446-382b01d4c99e@...1303...>
On Thu 06-04-17 09:33:44, Adrian Hunter wrote:
> On 05/04/17 14:39, Vlastimil Babka wrote:
> > On 04/05/2017 01:36 PM, Richard Weinberger wrote:
> >> Michal,
> >>
> >> Am 05.04.2017 um 13:31 schrieb Michal Hocko:
> >>> On Wed 05-04-17 09:47:00, Vlastimil Babka wrote:
> >>>> Nandsim has own functions set_memalloc() and clear_memalloc() for robust
> >>>> setting and clearing of PF_MEMALLOC. Replace them by the new generic helpers.
> >>>> No functional change.
> >>>
> >>> This one smells like an abuser. Why the hell should read/write path
> >>> touch memory reserves at all!
> >>
> >> Could be. Let's ask Adrian, AFAIK he wrote that code.
> >> Adrian, can you please clarify why nandsim needs to play with PF_MEMALLOC?
> >
> > I was thinking about it and concluded that since the simulator can be
> > used as a block device where reclaimed pages go to, writing the data out
> > is a memalloc operation. Then reading can be called as part of r-m-w
> > cycle, so reading as well.
>
> IIRC it was to avoid getting stuck with nandsim waiting on memory reclaim
> and memory reclaim waiting on nandsim.
I've got lost in the indirection. Could you describe how would reclaim
get stuck waiting on these paths please?
--
Michal Hocko
SUSE Labs
Reply to: