mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "zhangfei.gao@foxmail.com" <zhangfei.gao@foxmail.com>
To: Neeraj Upadhyay <quic_neeraju@quicinc.com>,
	Shameerali Kolothum Thodi  <shameerali.kolothum.thodi@huawei.com>,
	"paulmck@kernel.org" <paulmck@kernel.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Zhangfei Gao <zhangfei.gao@linaro.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"rcu@vger.kernel.org" <rcu@vger.kernel.org>,
	Lai Jiangshan <jiangshanlai@gmail.com>,
	Josh Triplett <josh@joshtriplett.org>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	Matthew Wilcox <willy@infradead.org>,
	"mtosatti@redhat.com" <mtosatti@redhat.com>,
	Auger Eric <eric.auger@redhat.com>,
	"chenxiang (M)" <chenxiang66@hisilicon.com>
Subject: Re: Commit 282d8998e997 (srcu: Prevent expedited GPs and blocking readers from consuming CPU) cause qemu boot slow
Date: Tue, 14 Jun 2022 22:57:04 +0800	[thread overview]
Message-ID: <tencent_0783451107DBB16AC54D4269800D941D0708@qq.com> (raw)
In-Reply-To: <88780123-32a3-ab34-cd3d-01e4a3421f03@quicinc.com>



On 2022/6/14 下午10:14, Neeraj Upadhyay wrote:
>
>
> On 6/14/2022 7:33 PM, zhangfei.gao@foxmail.com wrote:
>>
>>
>> On 2022/6/14 下午8:19, Neeraj Upadhyay wrote:
>>>
>>>>
>>>> 5.18-rc4 based               ~8sec
>>>>
>>>> 5.19-rc1                     ~2m43sec
>>>>
>>>> 5.19-rc1+fix1                 ~19sec
>>>>
>>>> 5.19-rc1-fix2                 ~19sec
>>>>
>>>
>>> If you try below diff on top of either 5.19-rc1+fix1 or 
>>> 5.19-rc1-fix2 ; does it show any difference in boot time?
>>>
>>> --- a/kernel/rcu/srcutree.c
>>> +++ b/kernel/rcu/srcutree.c
>>> @@ -706,7 +706,7 @@ static void srcu_schedule_cbs_snp(struct 
>>> srcu_struct *ssp, struct srcu_node *snp
>>>   */
>>>  static void srcu_gp_end(struct srcu_struct *ssp)
>>>  {
>>> -       unsigned long cbdelay;
>>> +       unsigned long cbdelay = 1;
>>>         bool cbs;
>>>         bool last_lvl;
>>>         int cpu;
>>> @@ -726,7 +726,9 @@ static void srcu_gp_end(struct srcu_struct *ssp)
>>>         spin_lock_irq_rcu_node(ssp);
>>>         idx = rcu_seq_state(ssp->srcu_gp_seq);
>>>         WARN_ON_ONCE(idx != SRCU_STATE_SCAN2);
>>> -       cbdelay = !!srcu_get_delay(ssp);
>>> +       if (ULONG_CMP_LT(READ_ONCE(ssp->srcu_gp_seq), 
>>> READ_ONCE(ssp->srcu_gp_seq_needed_exp)))
>>> +               cbdelay = 0;
>>> +
>>>         WRITE_ONCE(ssp->srcu_last_gp_end, ktime_get_mono_fast_ns());
>>>
>> Test here:
>> qemu: https://github.com/qemu/qemu/tree/stable-6.1
>> kernel: 
>> https://github.com/Linaro/linux-kernel-uadk/tree/uacce-devel-5.19-srcu-test
>> (in case test patch not clear, push in git tree)
>>
>> Hardware: aarch64
>>
>> 1. 5.18-rc6
>> real    0m8.402s
>> user    0m3.015s
>> sys     0m1.102s
>>
>> 2. 5.19-rc1
>> real    2m41.433s
>> user    0m3.097s
>> sys     0m1.177s
>>
>> 3. 5.19-rc1 + fix1 from Paul
>> real    2m43.404s
>> user    0m2.880s
>> sys     0m1.214s
>>
>> 4. 5.19-rc1 + fix2: fix1 + Remove "if (!jbase)" block
>> real    0m15.262s
>> user    0m3.003s
>> sys     0m1.033s
>>
>> When build kernel in the meantime, load time become longer.
>>
>> 5. 5.19-rc1 + fix3: fix1 + SRCU_MAX_NODELAY_PHASE 1000000
>> real    0m15.215s
>> user    0m2.942s
>> sys    0m1.172s
>>
>> 6. 5.19-rc1 + fix4: fix1 + Neeraj's change of srcu_gp_end 
>> real    1m23.936s
>> user    0m2.969s
>> sys    0m1.181s
>>
>
7. 5.19-rc1 + fix5: fix4 + Remove "if (!jbase)" block

real 0m11.418s

user 0m3.031s

sys 0m1.067s



8. 5.19-rc1 + fix 6: fix4 + SRCU_MAX_NODELAY_PHASE 1000000

real 0m11.154s ~12s

user 0m2.919s

sys 0m1.064s


Thanks

> Thanks for this data. Can you please share below test combo also?
>
> 7. 5.19-rc1 + fix5: fix2 + Neeraj's change of srcu_gp_end
>
>
> 8. 5.19-rc1 + fix6: fix3 + Neeraj's change of srcu_gp_end
>
>
> Thanks
> Neeraj
>
>> More test details: https://docs.qq.com/doc/DRXdKalFPTVlUbFN5
>>
>> Thanks
>>


  reply	other threads:[~2022-06-14 14:57 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-11 16:32 Zhangfei Gao
2022-06-11 16:59 ` Paul E. McKenney
2022-06-12  7:40   ` zhangfei.gao
2022-06-12 13:36     ` Paul E. McKenney
2022-06-12 14:59       ` zhangfei.gao
2022-06-12 16:20         ` Paul E. McKenney
2022-06-12 16:40           ` Paul E. McKenney
2022-06-12 17:29             ` Paolo Bonzini
2022-06-12 17:47               ` Paolo Bonzini
2022-06-12 18:51                 ` Paul E. McKenney
2022-06-12 18:49               ` Paul E. McKenney
2022-06-12 19:23                 ` Paolo Bonzini
2022-06-12 20:09                   ` Paul E. McKenney
2022-06-13  3:04                 ` zhangfei.gao
2022-06-13  3:57                   ` Paul E. McKenney
2022-06-13  4:16                     ` Paul E. McKenney
2022-06-13  6:55                       ` zhangfei.gao
2022-06-13 12:18                         ` Paul E. McKenney
2022-06-13 13:23                           ` zhangfei.gao
2022-06-13 14:59                             ` Paul E. McKenney
2022-06-13 20:55                               ` Shameerali Kolothum Thodi
2022-06-14 12:19                                 ` Neeraj Upadhyay
2022-06-14 14:03                                   ` zhangfei.gao
2022-06-14 14:14                                     ` Neeraj Upadhyay
2022-06-14 14:57                                       ` zhangfei.gao [this message]
2022-06-14 14:17                                     ` Paul E. McKenney
2022-06-15  9:03                                       ` zhangfei.gao
2022-06-15 10:40                                         ` Neeraj Upadhyay
2022-06-15 10:50                                           ` Paolo Bonzini
2022-06-15 11:04                                             ` Neeraj Upadhyay
2022-06-18  3:07                                           ` zhangfei.gao
2022-06-20  7:50                                             ` Neeraj Upadhyay
2022-06-24 15:30                                               ` zhangfei.gao
2022-06-13 15:02                         ` Shameerali Kolothum Thodi
2022-06-15  8:38                           ` Marc Zyngier
2022-06-15  8:29                         ` Marc Zyngier
2022-06-14  1:53 ` chenxiang (M)

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=tencent_0783451107DBB16AC54D4269800D941D0708@qq.com \
    --to=zhangfei.gao@foxmail.com \
    --cc=chenxiang66@hisilicon.com \
    --cc=eric.auger@redhat.com \
    --cc=jiangshanlai@gmail.com \
    --cc=josh@joshtriplett.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mtosatti@redhat.com \
    --cc=paulmck@kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=quic_neeraju@quicinc.com \
    --cc=rcu@vger.kernel.org \
    --cc=shameerali.kolothum.thodi@huawei.com \
    --cc=willy@infradead.org \
    --cc=zhangfei.gao@linaro.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

all inboxes | Powered by JetHome®