linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Wei Yang <richard.weiyang@gmail.com>
To: Dave Hansen <dave.hansen@intel.com>
Cc: Wei Yang <richard.weiyang@gmail.com>,
	akpm@linux-foundation.org, mhocko@suse.com, rientjes@google.com,
	linux-mm@kvack.org, kirill.shutemov@linux.intel.com
Subject: Re: [PATCH 1/3] mm/sparse: add likely to mem_section[root] check in sparse_index_init()
Date: Tue, 11 Sep 2018 15:00:48 +0000	[thread overview]
Message-ID: <20180911150048.5q6zmpz5m5cx3syu@master> (raw)
In-Reply-To: <5140697b-540a-1db1-e300-af1aaece97ad@intel.com>

On Mon, Sep 10, 2018 at 01:30:11PM -0700, Dave Hansen wrote:
>On 09/08/2018 06:38 PM, owner-linux-mm@kvack.org wrote:
>> 
>> At last, here is the test result on my 4G virtual machine. I added printk
>> before and after sparse_memory_present_with_active_regions() and tested three
>> times with/without "likely".
>> 
>>                without      with
>>     Elapsed   0.000252     0.000250   -0.8%
>> 
>> The benefit seems to be too small on a 4G virtual machine or even this is not
>> stable. Not sure we can see some visible effect on a 32G machine.
>
>I think it's highly unlikely you have found something significant here.
>It's one system, in a VM and it's not being measured using a mechanism
>that is suitable for benchmarking (the kernel dmesg timestamps).
>
>Plus, if this is a really tight loop, the cpu's branch predictors will
>be good at it.

Hi, Dave

Thanks for your reply.

I think you are right. This part is not significant and cpu may do its
job well.

Hmm... I am still willing to hear your opinion on my analysis of this
situation. In which case we would use likely/unlikely.

For example, in this case the possibility is (255/ 256) if the system
has 32G RAM. Do we have a threshold of the possibility to use
likely/unlikely. Or we'd prefer not to use this any more? Let compiler
and cpu do their job.

Look forward your insights.

-- 
Wei Yang
Help you, Help me

  reply	other threads:[~2018-09-11 15:00 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-23 13:07 [PATCH 0/3] trivial code refine for sparsemem Wei Yang
2018-08-23 13:07 ` [PATCH 1/3] mm/sparse: add likely to mem_section[root] check in sparse_index_init() Wei Yang
2018-08-23 13:13   ` Michal Hocko
2018-08-23 22:57     ` Wei Yang
2018-08-24  7:31       ` Michal Hocko
2018-08-24  0:11   ` Dave Hansen
2018-08-24 15:07     ` Wei Yang
2018-09-03 22:27       ` Wei Yang
2018-09-09  1:38         ` Wei Yang
2018-09-10 20:30           ` Dave Hansen
2018-09-11 15:00             ` Wei Yang [this message]
2018-08-23 13:07 ` [PATCH 2/3] mm/sparse: expand the CONFIG_SPARSEMEM_EXTREME range in __nr_to_section() Wei Yang
2018-08-23 13:21   ` Michal Hocko
2018-08-23 23:03     ` Wei Yang
2018-08-24  0:09     ` Dave Hansen
2018-08-24 15:24       ` Wei Yang
2018-08-23 13:07 ` [PATCH 3/3] mm/sparse: use __highest_present_section_nr as the boundary for pfn check Wei Yang
2018-08-23 13:25   ` Michal Hocko
2018-08-23 14:00     ` Oscar Salvador
2018-08-23 19:17       ` Michal Hocko
2018-08-23 20:52         ` Oscar Salvador
2018-08-24  0:15   ` Dave Hansen
2018-08-24 18:11     ` 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=20180911150048.5q6zmpz5m5cx3syu@master \
    --to=richard.weiyang@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=dave.hansen@intel.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    --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