mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Li,Rongqing" <lirongqing@baidu.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Davidlohr Bueso" <dbueso@suse.de>,
	Dominik Brodowski <linux@dominikbrodowski.net>,
	Manfred Spraul <manfred@colorfullife.com>,
	Arnd Bergmann <arnd@arndb.de>
Subject: 答复: [PATCH] ipc: prevent lockup on alloc_msg and free_msg
Date: Fri, 8 Mar 2019 02:03:43 +0000	[thread overview]
Message-ID: <f04f089a3312471bb795e8d9e1254a26@baidu.com> (raw)
In-Reply-To: <20190307101010.919d18394ae43ecf9d2a2212@linux-foundation.org>



> -----邮件原件-----
> 发件人: linux-kernel-owner@vger.kernel.org
> [mailto:linux-kernel-owner@vger.kernel.org] 代表 Andrew Morton
> 发送时间: 2019年3月8日 2:10
> 收件人: Li,Rongqing <lirongqing@baidu.com>
> 抄送: linux-kernel@vger.kernel.org; Davidlohr Bueso <dbueso@suse.de>;
> Dominik Brodowski <linux@dominikbrodowski.net>; Manfred Spraul
> <manfred@colorfullife.com>; Arnd Bergmann <arnd@arndb.de>
> 主题: Re: [PATCH] ipc: prevent lockup on alloc_msg and free_msg
> 
> On Thu,  7 Mar 2019 16:10:22 +0800 Li RongQing <lirongqing@baidu.com>
> wrote:
> 
> > From: Li Rongqing <lirongqing@baidu.com>
> >
> > msgctl10 of ltp triggers the following lockup When CONFIG_KASAN is
> > enabled on large memory SMP systems, the pages initialization can take
> > a long time, if msgctl10 requests a huge block memory, and it will
> > block rcu scheduler, so release cpu actively.
> >
> > ...
> >
> > Signed-off-by: Zhang Yu <zhangyu31@baidu.com>
> > Signed-off-by: Li RongQing <lirongqing@baidu.com>
> 
> This signoff ordering somewhat implies that Zhang Yu was the author.
> But you added "From: Li Rongqing", so you will be recorded as the patch's
> author.  Is this correct?
> 
Thanks for your review.
I will revert this order

> > --- a/ipc/msgutil.c
> > +++ b/ipc/msgutil.c
> > @@ -18,6 +18,7 @@
> >  #include <linux/utsname.h>
> >  #include <linux/proc_ns.h>
> >  #include <linux/uaccess.h>
> > +#include <linux/sched.h>
> >
> >  #include "util.h"
> >
> > @@ -72,6 +73,7 @@ static struct msg_msg *alloc_msg(size_t len)
> >  		seg->next = NULL;
> >  		pseg = &seg->next;
> >  		len -= alen;
> > +		cond_resched();
> >  	}
> 
> This looks OK.
> 
> >  	return msg;
> > @@ -178,5 +180,6 @@ void free_msg(struct msg_msg *msg)
> >  		struct msg_msgseg *tmp = seg->next;
> >  		kfree(seg);
> >  		seg = tmp;
> > +		cond_resched();
> >  	}
> 
> This does not.  mqueue_evict_inode() (at least) calls free_msg() from under
> spin_lock().


I will try to fix it by moving the free_msg() out of spinlock , thanks

-RongQing


      reply	other threads:[~2019-03-08  2:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-07  8:10 Li RongQing
2019-03-07 18:10 ` Andrew Morton
2019-03-08  2:03   ` Li,Rongqing [this message]

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=f04f089a3312471bb795e8d9e1254a26@baidu.com \
    --to=lirongqing@baidu.com \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=dbueso@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@dominikbrodowski.net \
    --cc=manfred@colorfullife.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

all inboxes | Powered by JetHome®