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:	Thu, 30 Jul 2015 13:09:37 +0300
From:	Dan Carpenter <dan.carpenter@...cle.com>
To:	"Wang, Biao" <biao.wang@...el.com>
Cc:	"gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
	"arve@...roid.com" <arve@...roid.com>,
	"riandrews@...roid.com" <riandrews@...roid.com>,
	"devel@...verdev.osuosl.org" <devel@...verdev.osuosl.org>,
	"Zhang, Di" <di.zhang@...el.com>, "Li, Fei" <fei.li@...el.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] improve lmk to avoid deadlock issue

I'm not an android dev but this patch seems reasonable enough.  There
are some process issues though.

1) The subject should have a subsystem prefix:

[PATCH] Staing: android: lowmemorykiller: improve lmk to avoid deadlock issue


On Thu, Jul 30, 2015 at 06:49:53AM +0000, Wang, Biao wrote:
> From: "wang, biao" <biao.wang@...el.com>
> Date: Thu, 30 Jul 2015 14:14:44 +0800
> Subject: [PATCH] improve lmk to avoid deadlock issue

2)  Don't put these lines in the patch.

> 
> Consider the following case:
> Task A trigger lmk with a lock held, while process B try to
> get this lock, but unfortunately B is the very culprit Task lmk select to
> kill.
> So B will never be killed, and A will forever select B to kill and
> such dead lock trigger softlock up issue.
> This patch try to pick the next task to break this loop.
> 
> Signed-off-by: wang, biao <biao.wang@...el.com>

3) Use capital letters for your name here.  It should match your email
address.

> Signed-off-by: Zhang Di <di.zhang@...el.com>

4) Did Zhang write this patch?  If so then add a From: tag at the top
of the email to give authorship credit.  Signed-off-by tags mean that
the patch went through your hands somehow.  Otherwise use the
Reviewed-by, Reported-by, or Acked-by tag whichever is appropriate.

> ---
>  drivers/staging/android/lowmemorykiller.c |   14 +++++++++-----
>  1 file changed, 9 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/staging/android/lowmemorykiller.c b/drivers/staging/android/lowmemorykiller.c
> index feafa17..efabeb7 100644
> --- a/drivers/staging/android/lowmemorykiller.c
> +++ b/drivers/staging/android/lowmemorykiller.c
> @@ -127,11 +127,15 @@ static unsigned long lowmem_scan(struct shrinker *s, struct shrink_control *sc)
>  		if (!p)
>  			continue;
>  
> -		if (test_tsk_thread_flag(p, TIF_MEMDIE) &&
> -		    time_before_eq(jiffies, lowmem_deathpending_timeout)) {
> -			task_unlock(p);
> -			rcu_read_unlock();
> -			return 0;
> +		if (test_tsk_thread_flag(p, TIF_MEMDIE)) {
> +			if (time_before_eq(jiffies, lowmem_deathpending_timeout)) {

5) This goes over the 80 character limit.  Could you break it up like
this:

		if (test_tsk_thread_flag(p, TIF_MEMDIE)) {
			if (time_before_eq(jiffies,
					   lowmem_deathpending_timeout)) {
				task_unlock(p);

Anyway, thank for this patch.  Please fix these small process issues
and resend.

regards,
dan carpenter

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