From: "Huang\, Ying" <ying.huang@intel.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: "Huang\, Ying" <ying.huang@intel.com>
Cc: Eric Dumazet <eric.dumazet@gmail.com>,
<linux-kernel@vger.kernel.org>, Ingo Molnar <mingo@kernel.org>,
Michael Ellerman <mpe@ellerman.id.au>,
Borislav Petkov <bp@suse.de>,
Thomas Gleixner <tglx@linutronix.de>,
"Juergen Gross" <jgross@suse.com>, Aaron Lu <aaron.lu@intel.com>
Subject: Re: [PATCH 3/3] IPI: Avoid to use 2 cache lines for one call_single_data
Date: Mon, 28 Aug 2017 13:19:21 +0800 [thread overview]
Message-ID: <87a82kp8va.fsf@yhuang-dev.intel.com> (raw)
In-Reply-To: <8760dqln47.fsf@yhuang-dev.intel.com> (Ying Huang's message of "Mon, 14 Aug 2017 13:44:24 +0800")
"Huang, Ying" <ying.huang@intel.com> writes:
> Hi, Peter,
>
> "Huang, Ying" <ying.huang@intel.com> writes:
>
>> Peter Zijlstra <peterz@infradead.org> writes:
>>
>>> On Sat, Aug 05, 2017 at 08:47:02AM +0800, Huang, Ying wrote:
>>>> Yes. That looks good. So you will prepare the final patch? Or you
>>>> hope me to do that?
>>>
>>> I was hoping you'd do it ;-)
>>
>> Thanks! Here is the updated patch
>>
>> Best Regards,
>> Huang, Ying
>>
>> ---------->8----------
>> From 957735e9ff3922368286540dab852986fc7b23b5 Mon Sep 17 00:00:00 2001
>> From: Huang Ying <ying.huang@intel.com>
>> Date: Mon, 7 Aug 2017 16:55:33 +0800
>> Subject: [PATCH -v3] IPI: Avoid to use 2 cache lines for one
>> call_single_data
>>
>> struct call_single_data is used in IPI to transfer information between
>> CPUs. Its size is bigger than sizeof(unsigned long) and less than
>> cache line size. Now, it is allocated with no explicit alignment
>> requirement. This makes it possible for allocated call_single_data to
>> cross 2 cache lines. So that double the number of the cache lines
>> that need to be transferred among CPUs.
>>
>> This is resolved by requiring call_single_data to be aligned with the
>> size of call_single_data. Now the size of call_single_data is the
>> power of 2. If we add new fields to call_single_data, we may need to
>> add pads to make sure the size of new definition is the power of 2.
>> Fortunately, this is enforced by gcc, which will report error for not
>> power of 2 alignment requirement.
>>
>> To set alignment requirement of call_single_data to the size of
>> call_single_data, a struct definition and a typedef is used.
>>
>> To test the effect of the patch, we use the vm-scalability multiple
>> thread swap test case (swap-w-seq-mt). The test will create multiple
>> threads and each thread will eat memory until all RAM and part of swap
>> is used, so that huge number of IPI will be triggered when unmapping
>> memory. In the test, the throughput of memory writing improves ~5%
>> compared with misaligned call_single_data because of faster IPI.
>
> What do you think about this version?
>
Ping.
Best Regards,
Huang, Ying
next prev parent reply other threads:[~2017-08-28 5:19 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-02 8:52 [PATCH 0/3] IPI: Avoid to use 2 cache lines for one call_single_data Huang, Ying
2017-08-02 8:52 ` [PATCH 1/3] percpu: Add alloc_percpu_aligned() Huang, Ying
2017-08-02 13:50 ` Christopher Lameter
2017-08-03 0:33 ` Huang, Ying
2017-08-02 8:52 ` [PATCH 2/3] iova: Use alloc_percpu_aligned() Huang, Ying
2017-08-02 8:52 ` [PATCH 3/3] IPI: Avoid to use 2 cache lines for one call_single_data Huang, Ying
2017-08-02 10:18 ` Eric Dumazet
2017-08-02 10:53 ` Peter Zijlstra
2017-08-03 8:35 ` Huang, Ying
2017-08-03 8:57 ` Peter Zijlstra
2017-08-04 1:28 ` Huang, Ying
2017-08-04 2:05 ` Huang, Ying
2017-08-04 9:27 ` Peter Zijlstra
2017-08-05 0:47 ` Huang, Ying
2017-08-07 8:28 ` Peter Zijlstra
2017-08-08 4:30 ` Huang, Ying
2017-08-14 5:44 ` Huang, Ying
2017-08-28 5:19 ` Huang, Ying [this message]
2017-08-28 8:49 ` Peter Zijlstra
2017-08-29 14:23 ` [tip:locking/core] smp: Avoid using two cache lines for struct call_single_data tip-bot for Ying Huang
2017-08-04 9:20 ` [PATCH 3/3] IPI: Avoid to use 2 cache lines for one call_single_data Peter Zijlstra
2017-08-02 13:54 ` [PATCH 0/3] " Christopher Lameter
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=87a82kp8va.fsf@yhuang-dev.intel.com \
--to=ying.huang@intel.com \
--cc=peterz@infradead.org \
/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