From: Tejun Heo <tj@kernel.org>
To: Wei Yang <weiyang@linux.vnet.ibm.com>
Cc: cl@linux-foundation.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] percpu: stop the loop when a cpu belongs to a new group
Date: Wed, 20 Nov 2013 00:51:21 -0500 [thread overview]
Message-ID: <20131120055121.GA13754@mtj.dyndns.org> (raw)
In-Reply-To: <20131120030056.GA15273@weiyang.vnet.ibm.com>
Hello,
On Wed, Nov 20, 2013 at 11:00:56AM +0800, Wei Yang wrote:
> What do you think about this one?
>
> >
> >From bd70498b9df47b25ff20054e24bb510c5430c0c3 Mon Sep 17 00:00:00 2001
> >From: Wei Yang <weiyang@linux.vnet.ibm.com>
> >Date: Thu, 10 Oct 2013 09:42:14 +0800
> >Subject: [PATCH] percpu: optimize group assignment when cpu_distance_fn is
> > NULL
> >
> >When cpu_distance_fn is NULL, all CPUs belongs to group 0. The original logic
> >will continue to go through each CPU and its predecessor. cpu_distance_fn is
> >always NULL when pcpu_build_alloc_info() is called from pcpu_page_first_chunk().
> >
> >By applying this patch, the time complexity will drop to O(n) form O(n^2) in
> >case cpu_distance_fn is NULL.
The test was put in the inner loop because the nesting was already too
deep and cpu_distance_fn is unlikely to be NULL on machines where the
number of CPUs is high enough to matter. If that O(n^2) loop is gonna
be a problem, it's gonna be a problem on large NUMA machines and we'll
have to do something about it for cases where cpu_distance_fn exists
anyway.
The patch is just extremely marginal. Ah well... why not? I'll apply
it once -rc1 drops.
Thanks.
--
tejun
--
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>
next prev parent reply other threads:[~2013-11-20 5:51 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-21 8:58 [PATCH 1/3] percpu: stop the loop when a cpu belongs to a new group Wei Yang
2013-10-21 8:58 ` [PATCH 2/3] percpu: merge two loops when setting up group info Wei Yang
2013-10-27 12:35 ` Tejun Heo
2013-10-28 2:37 ` Wei Yang
2013-10-21 8:58 ` [PATCH 3/3] percpu: little optimization on calculating pcpu_unit_size Wei Yang
2013-10-27 12:36 ` Tejun Heo
2013-10-28 2:43 ` Wei Yang
2013-10-27 12:30 ` [PATCH 1/3] percpu: stop the loop when a cpu belongs to a new group Tejun Heo
2013-10-28 3:00 ` Wei Yang
2013-10-28 11:31 ` Tejun Heo
2013-10-28 15:17 ` Wei Yang
2013-11-20 3:00 ` Wei Yang
2013-11-20 5:51 ` Tejun Heo [this message]
2013-11-20 6:58 ` Wei Yang
2013-11-22 23:04 ` Tejun Heo
2013-11-24 1:48 ` Wei Yang
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=20131120055121.GA13754@mtj.dyndns.org \
--to=tj@kernel.org \
--cc=cl@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=weiyang@linux.vnet.ibm.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).