[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAFnufp3ttev_u=Su2rO__BSj2bwAFVCD2bM9uqjXO=fdUhGrpQ@mail.gmail.com>
Date: Fri, 30 Jan 2026 01:04:27 +0100
From: Matteo Croce <technoboy85@...il.com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: linux-kernel@...r.kernel.org
Subject: Re: [PATCH] KUnit: memcpy: add benchmark
Il giorno ven 30 gen 2026 alle ore 00:53 Andrew Morton
<akpm@...ux-foundation.org> ha scritto:
>
> On Fri, 30 Jan 2026 00:36:30 +0100 Matteo Croce <technoboy85@...il.com> wrote:
>
> > > Is cond_resched() inside preempt_disable() actually legal?
> > >
> > > Might be, but it doesn't make a lot of sense, does it?
> > >
> > > > + }
> > > > + preempt_enable();
> > > > +
> > >
> >
> > Right. In a previous version I was doing
> > preempt_disable()/preempt_enable() around the two ktime_get_ns(), but
> > then I thought that enabling and disabling preemption 100 time was too
> > much.
> > I'll restore the preempt macros around the actual copy and remove
> > cond_resched().
>
> OK.
>
> local_irq_save() would be more accurate.
>
Right, even more strict.
> Does it really need to copy 4MB? Smaller would make
> local_irq_disable() more viable.
>
> kmalloc(4MB) does seem to be pushing our luck. I'm spotting
>
> ./arch/arm/configs/pxa_defconfig:CONFIG_ARCH_FORCE_MAX_ORDER=8
>
> which is 1MB?
I wanted to stay outside of the caches as much as possible.
What about using "PAGE_SIZE * (1 << CONFIG_ARCH_FORCE_MAX_ORDER)" so
it adjusts itself?
--
Matteo Croce
perl -e 'for($t=0;;$t++){print chr($t*($t>>8|$t>>13)&255)}' |aplay
Powered by blists - more mailing lists