From: Dan Carpenter <dan.carpenter@oracle.com>
To: "Wang, Biao" <biao.wang@intel.com>
Cc: "gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
"arve@android.com" <arve@android.com>,
"riandrews@android.com" <riandrews@android.com>,
"devel@driverdev.osuosl.org" <devel@driverdev.osuosl.org>,
"Zhang, Di" <di.zhang@intel.com>, "Li, Fei" <fei.li@intel.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] improve lmk to avoid deadlock issue
Date: Thu, 30 Jul 2015 13:09:37 +0300 [thread overview]
Message-ID: <20150730100937.GM5180@mwanda> (raw)
In-Reply-To: <09CB0B4607EB8F4DB7E0BE3B06BFBD051DA2DCAB@SHSMSX101.ccr.corp.intel.com>
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@intel.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@intel.com>
3) Use capital letters for your name here. It should match your email
address.
> Signed-off-by: Zhang Di <di.zhang@intel.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
next prev parent reply other threads:[~2015-07-30 10:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-30 6:49 [PATCH] improve lmk to avoid deadlock issue Wang, Biao
2015-07-30 10:09 ` Dan Carpenter [this message]
2015-07-30 12:29 ` Joe Perches
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150730100937.GM5180@mwanda \
--to=dan.carpenter@oracle.com \
--cc=arve@android.com \
--cc=biao.wang@intel.com \
--cc=devel@driverdev.osuosl.org \
--cc=di.zhang@intel.com \
--cc=fei.li@intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=riandrews@android.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox