linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Kirill A. Shutemov" <kirill@shutemov.name>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
	David Rientjes <rientjes@google.com>,
	Andrea Arcangeli <aarcange@redhat.com>,
	linux-mm@kvack.org
Subject: Re: [PATCH] thp: do not adjust zone water marks if khugepaged is not started
Date: Thu, 2 Apr 2015 15:08:24 +0300	[thread overview]
Message-ID: <20150402120824.GC24028@node.dhcp.inet.fi> (raw)
In-Reply-To: <20150327150026.7500f1081e8c30c2303afecd@linux-foundation.org>

On Fri, Mar 27, 2015 at 03:00:26PM -0700, Andrew Morton wrote:
> On Fri, 27 Mar 2015 14:47:08 -0700 Andrew Morton <akpm@linux-foundation.org> wrote:
> 
> > Fair enough, but take a look at start_khugepaged():
> > 
> > : static int start_khugepaged(void)
> > : {
> > : 	int err = 0;
> > : 	if (khugepaged_enabled()) {
> > : 		if (!khugepaged_thread)
> > : 			khugepaged_thread = kthread_run(khugepaged, NULL,
> > : 							"khugepaged");
> > : 		if (unlikely(IS_ERR(khugepaged_thread))) {
> > : 			pr_err("khugepaged: kthread_run(khugepaged) failed\n");
> > : 			err = PTR_ERR(khugepaged_thread);
> > : 			khugepaged_thread = NULL;
> > 
> > -->> stop here 
> > 
> > : 		}
> > : 
> > : 		if (!list_empty(&khugepaged_scan.mm_head))
> > : 			wake_up_interruptible(&khugepaged_wait);
> > : 
> > : 		set_recommended_min_free_kbytes();
> > : 	} else if (khugepaged_thread) {
> > : 		kthread_stop(khugepaged_thread);
> > : 		khugepaged_thread = NULL;
> > : 	}
> > : 
> > : 	return err;
> > : }
> 
> Looking more closely...  This code seems a bit screwy.
> 
> - why is set_recommended_min_free_kbytes() a late_initcall?  We've
>   already done that within
>   subsys_initcall->hugepage_init->set_recommended_min_free_kbytes()
> 
> - there isn't much point in running start_khugepaged() if we've just
>   set transparent_hugepage_flags to zero.
> 
> - start_khugepaged() is misnamed.
> 
> So something like this?

Looks like you didn't apply this. Here's proper patch:

  parent reply	other threads:[~2015-04-02 12:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-27 11:39 [PATCH] thp: do not adjust zone water marks if khugepaged is not started Kirill A. Shutemov
2015-03-27 21:47 ` Andrew Morton
2015-03-27 22:00   ` Andrew Morton
2015-03-27 22:08     ` Kirill A. Shutemov
2015-04-02 12:08     ` Kirill A. Shutemov [this message]
2015-03-27 22:00   ` Kirill A. Shutemov

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=20150402120824.GC24028@node.dhcp.inet.fi \
    --to=kirill@shutemov.name \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-mm@kvack.org \
    --cc=rientjes@google.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;
as well as URLs for NNTP newsgroup(s).