On Fri, 16 Feb 2001, Rajagopal Ananthanarayanan wrote:
> Marcelo Tosatti wrote:
> >
> > Hi,
> >
> > I noticed that _pagebuf_lookup_pages() may use two different allocation
> > flags to allocate invalid pages depending on PBF_MAPPABLE flag:
> >
> > /* For pagebufs where we want to map an address, do not use
> > * highmem pages - so that we do not need to use kmap resources
> > * to access the data.
> > */
> >
> > if (flags & PBF_MAPPABLE) {
> > gfp_mask = GFP_BUFFER;
> > } else {
> > gfp_mask = GFP_HIGHUSER;
> > }
> >
> > My question is if only when the caller sets PBF_MAPPABLE it may hold some
> > fs lock? (thats why GFP_BUFFER was used, I suppose)
>
> PBF_MAPPABLE is used by meta data users ... XFS keeps its
> meta data in pages hashed to the mount-point inode.
>
> All other callers, basically the file I/O paths, don't use MAPPABLE.
> For example, _pb_buffered_read would not use MAPPABLE.
>
> >
> > If callers which do not set PBF_MAPPABLE may have locks which are used on
> > the ->writepage() codepath, it may be a problem (deadlock).
> >
>
> Can you please elaborate on the deadlock scenario?
Thats what I wonder:
some_xfs_operation -> down(&lock) ->
_pagebuf_lookup_pages(_PBF_ENTER_PAGES) -> alloc_pages(GFP_HIGHUSER) ->
do_try_to_free_pages() -> try_to_free_pages() -> page_launder() ->
writepage() -> xfs_writepage() -> down(&lock)
Is that possible?
|