lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 6 Apr 2018 11:32:56 +0100
From:   Roman Gushchin <guro@...com>
To:     Andrew Morton <akpm@...ux-foundation.org>
CC:     Al Viro <viro@...IV.linux.org.uk>, <linux-mm@...ck.org>,
        Michal Hocko <mhocko@...e.com>,
        Johannes Weiner <hannes@...xchg.org>,
        <linux-fsdevel@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        <kernel-team@...com>
Subject: Re: [PATCH 3/3] dcache: account external names as indirectly
 reclaimable memory

On Thu, Apr 05, 2018 at 03:11:23PM -0700, Andrew Morton wrote:
> On Tue, 13 Mar 2018 00:45:32 +0000 Al Viro <viro@...IV.linux.org.uk> wrote:
> 
> > 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.
> 
> So.. where are we at with this issue?

I assume that commit 0babe6fe1da3 ("dcache: fix indirectly reclaimable memory accounting")
address the issue.

__d_free_external_name() is now called from all release paths (including __d_free_external())
and is the only place where NR_INDIRECTLY_RECLAIMABLE_BYTES is decremented.

__d_alloc()'s error path is slightly different, because I bump NR_INDIRECTLY_RECLAIMABLE_BYTES
in a very last moment, when it's already clear, that no errors did occur.
So we don't need to increase and decrease the counter back and forth.

Thank you!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ