lkml.org 
[lkml]   [2018]   [Mar]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/3] dcache: account external names as indirectly reclaimable memory
On Mon, Mar 12, 2018 at 10:36:38PM +0000, Roman Gushchin wrote:

> Ah, I see...
>
> I think, it's better to account them when we're actually freeing,
> otherwise we will have strange path:
> (indirectly) reclaimable -> unreclaimable -> free
>
> Do you agree?

> +static void __d_free_external_name(struct rcu_head *head)
> +{
> + struct external_name *name;
> +
> + name = container_of(head, struct external_name, u.head);
> +
> + mod_node_page_state(page_pgdat(virt_to_page(name)),
> + NR_INDIRECTLY_RECLAIMABLE_BYTES,
> + -ksize(name));
> +
> + kfree(name);
> +}

Maybe, but then you want to call that from __d_free_external() and from
failure path in __d_alloc() as well. Duplicating something that convoluted
and easy to get out of sync is just asking for trouble.

\
 
 \ /
  Last update: 2018-03-13 01:45    [W:0.640 / U:0.000 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site