linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Russell King - ARM Linux admin <linux@armlinux.org.uk>
To: Jens Axboe <axboe@kernel.dk>
Cc: "linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH] arm: add support for TIF_NOTIFY_SIGNAL
Date: Thu, 29 Oct 2020 17:01:10 +0000	[thread overview]
Message-ID: <20201029170110.GY1551@shell.armlinux.org.uk> (raw)
In-Reply-To: <b84456ac-1263-054d-2fe8-973621a2a8d4@kernel.dk>

On Thu, Oct 29, 2020 at 10:35:54AM -0600, Jens Axboe wrote:
> On 10/29/20 10:29 AM, Russell King - ARM Linux admin wrote:
> > On Thu, Oct 29, 2020 at 10:11:07AM -0600, Jens Axboe wrote:
> >> Wire up TIF_NOTIFY_SIGNAL handling for arm.
> >>
> >> Cc: linux-arm-kernel@lists.infradead.org
> >> Signed-off-by: Jens Axboe <axboe@kernel.dk>
> >> ---
> >>
> >> 5.11 has support queued up for TIF_NOTIFY_SIGNAL, see this posting
> >> for details:
> >>
> >> https://lore.kernel.org/io-uring/20201026203230.386348-1-axboe@kernel.dk/
> >>
> >> As part of that work, I'm adding TIF_NOTIFY_SIGNAL support to all archs,
> >> as that will enable a set of cleanups once all of them support it.
> >>
> >> This needs a bit of asm help, immediate doesn't like anything outside
> >> of 1 byte, it seems. Any clues?
> > 
> > Correct - immediates take an 8 bit value shifted by an even number of
> > bits.
> > 
> > I'm tempted to suggest that we simplify things by making TIF bits 0..15
> > invoke do_work_pending() no matter what - which will require a comment
> > in thread_info.h that all those bits will have that effect. The
> > resulting assembly would be:
> > 
> >  	ldr	r1, [tsk, #TI_FLAGS]		@ re-check for syscall tracing
> > -	tst	r1, #_TIF_SYSCALL_WORK | _TIF_WORK_MASK
> > +	movs	r1, r1, lsl #16
> > 
> > which avoids the additional load caused by "ldr r2, =..."
> > 
> > It's not like we're desperate for bits here.
> 
> So renumber TIF bits that don't need to worry about do_work_pending() >
> 15 then? I agree, there's plenty of bits available, so seems reasonable
> to me. But probably more work in terms of other bits being tested with
> tstcurrently - at least when I looked, I could not find any of them I
> could successfully remap from < 8 to > 8.
> 
> Any chance I can talk you into hacking that up?

I don't believe that there's any need to do any renumbering.

_TIF_WORK_MASK covers bits 0-3. _TIF_SYSCALL_WORK covers bits 4-7.
Then we have 17, 18, and 20 which are not used to trigger the
do_work_pending().

So, I think it's just a case of changing what you're doing in the
assembly to my suggestion, and adding a comment to thread_info.h
noting that bits 0-15 will trigger a call into do_work_pending()
when returning to userspace.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

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

  reply	other threads:[~2020-10-29 17:01 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-29 16:11 [PATCH] arm: add support for TIF_NOTIFY_SIGNAL Jens Axboe
2020-10-29 16:29 ` Russell King - ARM Linux admin
2020-10-29 16:35   ` Jens Axboe
2020-10-29 17:01     ` Russell King - ARM Linux admin [this message]
2020-10-29 17:15       ` Jens Axboe
2020-10-29 17:17         ` Russell King - ARM Linux admin
2020-10-29 17:20           ` Jens Axboe
2020-10-29 17:42             ` Russell King - ARM Linux admin
2020-10-29 17:50               ` Jens Axboe
2020-11-03 15:11               ` Jens Axboe
2020-11-12 15:32                 ` Russell King - ARM Linux admin
2020-11-12 15:42                   ` Jens Axboe
2020-11-12 15:44                     ` Russell King - ARM Linux admin
2020-11-12 15:51                       ` Jens Axboe

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=20201029170110.GY1551@shell.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=axboe@kernel.dk \
    --cc=linux-arm-kernel@lists.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;
as well as URLs for NNTP newsgroup(s).