From: Andrew Morton <akpm@linux-foundation.org>
To: Matteo Croce <technoboy85@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] KUnit: memcpy: add benchmark
Date: Thu, 29 Jan 2026 15:53:15 -0800 [thread overview]
Message-ID: <20260129155315.5897a90efedbc6988ebb3708@linux-foundation.org> (raw)
In-Reply-To: <CAFnufp3Ce-ssx4143_+zc4HWPMx4Rn9kAsVwoK=tqBfSXG0-qQ@mail.gmail.com>
On Fri, 30 Jan 2026 00:36:30 +0100 Matteo Croce <technoboy85@gmail.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.
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?
next prev parent reply other threads:[~2026-01-29 23:53 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-29 0:43 Matteo Croce
2026-01-29 23:20 ` Andrew Morton
2026-01-29 23:36 ` Matteo Croce
2026-01-29 23:53 ` Andrew Morton [this message]
2026-01-30 0:04 ` Matteo Croce
2026-01-30 0:07 ` Matteo Croce
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=20260129155315.5897a90efedbc6988ebb3708@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=technoboy85@gmail.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
all inboxes | Powered by JetHome®