linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hui Tang <tanghui20@huawei.com>
To: Russell King <linux@armlinux.org.uk>
Cc: <linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>, Jens Axboe <axboe@kernel.dk>,
	<tanghui20@huawei.com>
Subject: [bug-report] possible performance problem in ret_to_user_from_irq
Date: Mon, 26 Dec 2022 16:45:20 +0800	[thread overview]
Message-ID: <7ecb8f3c-2aeb-a905-0d4a-aa768b9649b5@huawei.com> (raw)

hi folks.

I found a performance problem which is introduced by commit
32d59773da38 ("arm: add support for TIF_NOTIFY_SIGNAL").
After the commit,  any bit in the range of 0..15 will cause
do_work_pending() to be invoked. More frequent do_work_pending()
invoked possible result in worse performance.

Some of the tests I've done, as follows:
lmbench test			base		with patch
./lat_ctx -P 1 -s 0  2		7.3167		11.04
./lat_ctx -P 1 -s 16 2          8.0467		14.5367
./lat_ctx -P 1 -s 64 2		7.8667		11.43
./lat_ctx -P 1 -s 16 16		16.47		18.3667
./lat_pipe -P 1			28.1671		44.7904

libMicro-0.4.1 test		base		with patch
./cascade_cond -E -C 200\
  -L -S -W -N "c_cond_1" -I 100	286.3333	358

When I adjust test bit, the performance problem gone.
-	movs	r1, r1, lsl #16
+	ldr	r2, =#_TIF_WORK_MASK
+	tst	r1, r2

Does anyone have a good suggestion for this problem?
should just test _TIF_WORK_MASK, as before?

             reply	other threads:[~2022-12-26  8:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-26  8:45 Hui Tang [this message]
2023-01-03 10:06 ` [bug-report] possible performance problem in ret_to_user_from_irq Russell King (Oracle)
2023-01-03 14:25   ` Jens Axboe
2023-01-03 14:34     ` Russell King (Oracle)
2023-01-03 14:59       ` Jens Axboe
2023-01-04  1:31         ` Hui Tang
2023-01-04  7:04         ` Hui Tang
2023-01-04 14:45           ` 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=7ecb8f3c-2aeb-a905-0d4a-aa768b9649b5@huawei.com \
    --to=tanghui20@huawei.com \
    --cc=axboe@kernel.dk \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    /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).