xfs
[Top] [All Lists]

Re: _pagebuf_lookup_pages() allocation flags

To: Marcelo Tosatti <marcelo@xxxxxxxxxxxxxxxx>
Subject: Re: _pagebuf_lookup_pages() allocation flags
From: Rajagopal Ananthanarayanan <ananth@xxxxxxx>
Date: Fri, 16 Feb 2001 14:07:40 -0800
Cc: linux-xfs@xxxxxxxxxxx
References: <Pine.LNX.4.21.0102161755110.769-100000@xxxxxxxxxxxxxxxxxxxxxx>
Sender: owner-linux-xfs@xxxxxxxxxxx
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?

-- 
--------------------------------------------------------------------------
Rajagopal Ananthanarayanan ("ananth")
Member Technical Staff, SGI.
--------------------------------------------------------------------------

<Prev in Thread] Current Thread [Next in Thread>