linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@suse.com>
To: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Cc: Yang Shi <yang.s@alibaba-inc.com>,
	kirill.shutemov@linux.intel.com, hughd@google.com,
	aarcange@redhat.com, akpm@linux-foundation.org,
	linux-mm@kvack.org
Subject: Re: [PATCH] mm: thp: use down_read_trylock in khugepaged to avoid long block
Date: Tue, 19 Dec 2017 12:39:17 +0100	[thread overview]
Message-ID: <20171219113917.GJ2787@dhcp22.suse.cz> (raw)
In-Reply-To: <fb89021a-a6f6-8bdb-4c9d-b66686589530@I-love.SAKURA.ne.jp>

On Tue 19-12-17 20:29:56, Tetsuo Handa wrote:
> On 2017/12/15 4:53, Yang Shi wrote:
> > diff --git a/mm/khugepaged.c b/mm/khugepaged.c
> > index ea4ff25..ecc2b68 100644
> > --- a/mm/khugepaged.c
> > +++ b/mm/khugepaged.c
> > @@ -1674,7 +1674,12 @@ static unsigned int khugepaged_scan_mm_slot(unsigned int pages,
> >  	spin_unlock(&khugepaged_mm_lock);
> >  
> >  	mm = mm_slot->mm;
> > -	down_read(&mm->mmap_sem);
> > +	/*
> > + 	 * Not wait for semaphore to avoid long time waiting, just move
> > + 	 * to the next mm on the list.
> > + 	 */
> > +	if (unlikely(!down_read_trylock(&mm->mmap_sem)))
> > +		goto breakouterloop_mmap_sem;
> >  	if (unlikely(khugepaged_test_exit(mm)))
> >  		vma = NULL;
> >  	else
> > 
> 
> You are jumping before initializing vma.
> 
> mm/khugepaged.c: In function a??khugepageda??:
> mm/khugepaged.c:1757:31: warning: a??vmaa?? may be used uninitialized in this function [-Wmaybe-uninitialized]
>   if (khugepaged_test_exit(mm) || !vma) {
>       ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
> mm/khugepaged.c:1659:25: note: a??vmaa?? was declared here
>   struct vm_area_struct *vma;
>                          ^~~ 

http://lkml.kernel.org/r/20171215125129.2948634-1-arnd@arndb.de

-- 
Michal Hocko
SUSE Labs

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

      reply	other threads:[~2017-12-19 11:39 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-14 19:53 Yang Shi
2017-12-15  4:34 ` Anshuman Khandual
2017-12-15  9:33   ` Kirill A. Shutemov
2017-12-15 10:27 ` Michal Hocko
2017-12-15 20:04   ` Yang Shi
2017-12-16 11:45     ` Michal Hocko
2017-12-16 20:09       ` Kirill A. Shutemov
2017-12-16 22:22         ` Yang Shi
2017-12-18  8:41         ` Michal Hocko
2017-12-18 10:14           ` Kirill A. Shutemov
2017-12-20  1:35           ` Yang Shi
2017-12-19 11:29 ` Tetsuo Handa
2017-12-19 11:39   ` Michal Hocko [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=20171219113917.GJ2787@dhcp22.suse.cz \
    --to=mhocko@suse.com \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=hughd@google.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-mm@kvack.org \
    --cc=penguin-kernel@I-love.SAKURA.ne.jp \
    --cc=yang.s@alibaba-inc.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