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:	Tue, 22 Apr 2014 18:58:11 +0800
From:	Jianyu Zhan <nasa4836@...il.com>
To:	Michal Hocko <mhocko@...e.cz>
Cc:	Johannes Weiner <hannes@...xchg.org>,
	Balbir Singh <bsingharora@...il.com>,
	kamezawa.hiroyu@...fujitsu.com, Cgroups <cgroups@...r.kernel.org>,
	"linux-mm@...ck.org" <linux-mm@...ck.org>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/2] mm/memcontrol.c: remove meaningless while loop in mem_cgroup_iter()

On Tue, Apr 22, 2014 at 6:34 PM, Michal Hocko <mhocko@...e.cz> wrote:
> Sorry, I should have been more specific that I was talking about
> mem_cgroup_reclaim_cookie path where the iteration for this particular
> zone and priority ended at the last node without finishing the full
> roundtrip last time. This new iteration (prev==NULL) wants to continue
> and it should start a new roundtrip.
>
> Makes sense?

Hi, Michal,

Good catch, it makes sense !
This reminds me of my draft edition of this patch, I specifically handle
this case as:

if (reclaim) {
               if (!memcg ) {
                              iter->generation++;
                              if (!prev) {
                                    memcg = root;
                                    mem_cgroup_iter_update(iter, NULL,
memcg, root,  seq);
                                    goto out_unlock:
                              }
              }
              mem_cgroup_iter_update(iter, last_visited, memcg, root,
                                seq);
              if (!prev && memcg)
                        reclaim->generation = iter->generation;
}

This is literally manual unwinding the second while loop, and thus omit
the while loop,
to save a   mem_cgroup_iter_update() and a mem_cgroup_iter_update()

But it maybe a bit hard to read.

If it is OK, I could resend a new one.

Thanks,
Jianyu Zhan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ