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:	Mon, 6 Feb 2012 16:36:37 -0500
From:	KOSAKI Motohiro <kosaki.motohiro@...il.com>
To:	Anton Vorontsov <anton.vorontsov@...aro.org>
Cc:	Oleg Nesterov <oleg@...hat.com>,
	Greg KH <gregkh@...uxfoundation.org>,
	Arve Hjønnevåg <arve@...roid.com>,
	San Mehat <san@...gle.com>, Colin Cross <ccross@...roid.com>,
	"Eric W. Biederman" <ebiederm@...ssion.com>,
	"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
	linux-kernel@...r.kernel.org, kernel-team@...roid.com,
	linaro-kernel@...ts.linaro.org
Subject: Re: [PATCH 4/6] staging: android/lowmemorykiller: Better mm handling

>  static int lowmem_shrink(struct shrinker *s, struct shrink_control *sc)
>  {
> -       struct task_struct *p;
> +       struct task_struct *tsk;
>        struct task_struct *selected = NULL;
>        int rem = 0;
>        int tasksize;
> @@ -134,15 +134,17 @@ static int lowmem_shrink(struct shrinker *s, struct shrink_control *sc)
>        selected_oom_adj = min_adj;
>
>        rcu_read_lock();
> -       for_each_process(p) {
> -               struct mm_struct *mm;
> +       for_each_process(tsk) {
> +               struct task_struct *p;
>                struct signal_struct *sig;
>                int oom_adj;
>
> -               task_lock(p);
> -               mm = p->mm;
> +               p = find_lock_task_mm(tsk);
> +               if (!p)
> +                       continue;
> +
>                sig = p->signal;
> -               if (!mm || !sig) {
> +               if (!sig) {
>                        task_unlock(p);
>                        continue;
>                }
> @@ -151,7 +153,7 @@ static int lowmem_shrink(struct shrinker *s, struct shrink_control *sc)
>                        task_unlock(p);
>                        continue;
>                }
> -               tasksize = get_mm_rss(mm);
> +               tasksize = get_mm_rss(p->mm);
>                task_unlock(p);
>                if (tasksize <= 0)
>                        continue;

ack.
--
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