linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Question regarding ext4_journalled_aops: lack of migrate_page
@ 2020-10-09  6:42 Chris Goldsworthy
  2020-10-09 16:47 ` Chris Goldsworthy
  0 siblings, 1 reply; 2+ messages in thread
From: Chris Goldsworthy @ 2020-10-09  6:42 UTC (permalink / raw)
  To: tytso, adilger.kernel, linux-ext4, linux-kernel

Hi there,

ext4_aops and ext4_da_aops both have a migratepage callback, whereas 
ext4_journalled_aops lacks such a callback.  Why is this so?  I’m asking 
this due to the following: when a page containing EXT4 journal buffer 
heads ends up being migrated, fallback_migrate_page() is used, which 
eventually calls try_to_free_buffers(), which will call drop_buffers().  
Drop buffers() can fail for a page if that page is on the LRU list (see 
https://elixir.bootlin.com/linux/v5.8.14/source/fs/buffer.c#L3225).   
Now, if buffer_migrate_page() was supplied as the migratepage callback 
for the journaled aops, this wouldn’t be problem since we ignore the LRU 
lists altogether.

Resolving this issue will benefit CMA allocations, which might have to 
migrate movable pages that were allocated from a CMA region (the 
assumption is that these pages can be migrated once the memory backing 
these pages is needed).

Thanks,

Chris.

-- 
The Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora 
Forum,
a Linux Foundation Collaborative Project

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Question regarding ext4_journalled_aops: lack of migrate_page
  2020-10-09  6:42 Question regarding ext4_journalled_aops: lack of migrate_page Chris Goldsworthy
@ 2020-10-09 16:47 ` Chris Goldsworthy
  0 siblings, 0 replies; 2+ messages in thread
From: Chris Goldsworthy @ 2020-10-09 16:47 UTC (permalink / raw)
  To: tytso, adilger.kernel, linux-ext4, linux-kernel

tOn 2020-10-08 23:42, Chris Goldsworthy wrote:
> Hi there,
> 
> ext4_aops and ext4_da_aops both have a migratepage callback, whereas
> ext4_journalled_aops lacks such a callback.  Why is this so?  I’m
> asking this due to the following: when a page containing EXT4 journal
> buffer heads ends up being migrated, fallback_migrate_page() is used,
> which eventually calls try_to_free_buffers(), which will call
> drop_buffers().  Drop buffers() can fail for a page if that page is on
> the LRU list (see
> https://elixir.bootlin.com/linux/v5.8.14/source/fs/buffer.c#L3225).
> Now, if buffer_migrate_page() was supplied as the migratepage callback
> for the journaled aops, this wouldn’t be problem since we ignore the
> LRU lists altogether.
> 
> Resolving this issue will benefit CMA allocations, which might have to
> migrate movable pages that were allocated from a CMA region (the
> assumption is that these pages can be migrated once the memory backing
> these pages is needed).
> 
> Thanks,
> 
> Chris.

An alternative solution to to placing in a migratepage callback is to 
actually remove the buffer heads from an LRU list in drop_buffers() - we 
tried upstreaming such a patch some time ago: 
https://lore.kernel.org/patchwork/patch/325406/ .  This would solve the 
problem, and would avoid having to get a migratepage callback for any 
other files systems that have aops without the callback.  This didn't 
get off the ground however, I'm picking up the line of questioning left 
in the previous thread, to determine why EXT4 doesn't have a migratepage 
callback.

Thanks,

Chris.

-- 
The Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora 
Forum,
a Linux Foundation Collaborative Project

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-10-09 16:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-09  6:42 Question regarding ext4_journalled_aops: lack of migrate_page Chris Goldsworthy
2020-10-09 16:47 ` Chris Goldsworthy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).