lkml.org 
[lkml]   [2021]   [Dec]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v8 6/9] mm: Introduce mf_dax_kill_procs() for fsdax case
On Thu, Dec 02, 2021 at 04:48:53PM +0800, Shiyang Ruan wrote:
> @@ -254,6 +254,15 @@ static inline bool dax_mapping(struct address_space *mapping)
> {
> return mapping->host && IS_DAX(mapping->host);
> }
> +static inline unsigned long pgoff_address(pgoff_t pgoff,
> + struct vm_area_struct *vma)

Empty lines between functions please.

Also this name is a bit generic for something in dax.h, but then again
it does not seem to be DAX-specific, so it might want to move into
a generic MM header with a proper name and kerneldoc comment.

I think a calling conventions that puts the vma before the pgoff would
seem a little more logical as well.

Last but not least such a move should be in a separate patch.

> +extern int mf_dax_kill_procs(struct address_space *mapping, pgoff_t index,
> + unsigned long count, int mf_flags);

No need for the extern here.

> -static unsigned long dev_pagemap_mapping_shift(struct page *page,
> +static unsigned long dev_pagemap_mapping_shift(unsigned long address,
> struct vm_area_struct *vma)

Passing the vma first would seem more logical again.

> + if (is_zone_device_page(p)) {
> + /*
> + * Since page->mapping is no more used for fsdax, we should
> + * calculate the address in a fsdax way.
> + */

/*
* Since page->mapping is not used for fsdax, we need
* calculate the address based on the vma.
*/

> +static void collect_procs_fsdax(struct page *page, struct address_space *mapping,
> + pgoff_t pgoff, struct list_head *to_kill)

Overly long line here.

\
 
 \ /
  Last update: 2021-12-14 16:47    [W:0.071 / U:0.384 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site