linux-riscv.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: "Björn Töpel" <bjorn.topel@gmail.com>
To: Christopher Lameter <cl@linux.com>
Cc: Nick Kossifidis <mick@ics.forth.gr>,
	Paul Walmsley <paul@pwsan.com>,
	Palmer Dabbelt <palmer@sifive.com>,
	linux-riscv@lists.infradead.org
Subject: Re: per-cpu thoughts
Date: Mon, 11 Mar 2019 17:35:26 +0100	[thread overview]
Message-ID: <CAJ+HfNigK=FiWDtNaJm5-8QP1MEa9M+=B1PnFLGTPX5oXZRm+g@mail.gmail.com> (raw)
In-Reply-To: <010001696d73c925-5f894cf1-aa67-4e05-8e76-123a4b4c6904-000000@email.amazonses.com>

On Mon, 11 Mar 2019 at 16:51, Christopher Lameter <cl@linux.com> wrote:
>
> On Mon, 11 Mar 2019, Bjï¿œrn Tï¿œpel wrote:
>
> > > > Hmm, you mean AMO *with* preempt_{dis,en}able, right? (No, interrupt
> > > > disable, only preemption.)
> > >
> > > If you disable preemption then you dont need AMO anymore. In fact that is
> > > the default fallback generic implementation. Just dont do anything and you
> > > already have that solution.
> >
> > But the generic one disables interrupts, right?
>
> No it doesnt.
>

Ok, please educate me what I'm missing here.

From asm-generic/percpu.h:

#define this_cpu_generic_to_op(pcp, val, op)                \
do {                                    \
    unsigned long __flags;                        \
    raw_local_irq_save(__flags);                    \
    raw_cpu_generic_to_op(pcp, val, op);                \
    raw_local_irq_restore(__flags);                    \
} while (0)

And the disassembly from my build does indeed have interrupt disabled regions.

Sorry for being a bit slow here. :-)


Björn

> > I believe the rational for RV is similar to ARM's; AMO+preemption
> > disable regions is *slightly* better than the generic, but not as good
> > as the IA one. Or am I missing something?>
>
> Looks to me that the better solution for  ARM may be to drop its
> implementation and revert to the generic one.
>
> The overhead of AMOs is likely too high to justify using those. And the
> LC/SC overhead is also generating useless overhead.
>
> If you benchmark those then please be aware that the kernel uses
> __this_xxx ops in places where the preempt disable is not needed. The
> savings come in the form of this_xxx ops where we avoid the overhead of
> enabling and disabling preemption (which can be significant especialy
> given the scheduler actions).

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

  reply	other threads:[~2019-03-11 16:35 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-20 19:57 per-cpu thoughts Björn Töpel
2019-02-21 15:57 ` Christopher Lameter
2019-02-21 16:28 ` Paul Walmsley
2019-02-21 17:24   ` Björn Töpel
2019-02-21 17:49     ` Paul Walmsley
2019-02-21 19:40       ` Palmer Dabbelt
2019-02-22 15:04         ` Christopher Lameter
2019-02-22 15:36           ` Nick Kossifidis
2019-02-22 15:56             ` Christopher Lameter
2019-02-22 19:47               ` Björn Töpel
2019-02-22 19:56                 ` Christopher Lameter
2019-02-28 12:20                   ` Paul Walmsley
2019-02-28 17:58                     ` Christopher Lameter
2019-02-28 18:42                       ` Paul Walmsley
2019-02-28 19:09                         ` Christopher Lameter
2019-02-28 20:21                           ` Paul Walmsley
2019-03-01  1:13                             ` Christopher Lameter
2019-03-08  7:17                   ` Björn Töpel
2019-03-11 13:22                     ` Palmer Dabbelt
2019-03-11 14:48                       ` Björn Töpel
2019-03-11 14:56                         ` Christopher Lameter
2019-03-11 15:05                           ` Björn Töpel
2019-03-11 15:26                             ` Paul Walmsley
2019-03-11 16:48                               ` Mark Rutland
2019-03-11 18:39                                 ` Paul Walmsley
2019-03-12 11:23                                   ` Mark Rutland
2019-03-12 16:01                                     ` Paul Walmsley
2019-03-12 17:34                                       ` Christopher Lameter
2019-03-12  4:26                               ` Christopher Lameter
2019-03-12 14:21                                 ` Paul Walmsley
2019-03-12 17:42                                   ` Christopher Lameter
2019-03-12 17:59                                     ` Gary Guo
2019-03-13 18:58                                       ` Christopher Lameter
2019-03-13 20:15                                     ` Paul Walmsley
2019-03-22 14:51                               ` Nick Kossifidis
2019-03-22 17:57                                 ` Christopher Lameter
2019-03-11 15:51                             ` Christopher Lameter
2019-03-11 16:35                               ` Björn Töpel [this message]
2019-03-12  4:22                                 ` Christopher Lameter
2019-02-22 19:48             ` Björn Töpel
2019-02-22 20:53               ` Nick Kossifidis

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='CAJ+HfNigK=FiWDtNaJm5-8QP1MEa9M+=B1PnFLGTPX5oXZRm+g@mail.gmail.com' \
    --to=bjorn.topel@gmail.com \
    --cc=cl@linux.com \
    --cc=linux-riscv@lists.infradead.org \
    --cc=mick@ics.forth.gr \
    --cc=palmer@sifive.com \
    --cc=paul@pwsan.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).