lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y7P+MjPNA6Tg8JBr@shell.armlinux.org.uk>
Date:   Tue, 3 Jan 2023 10:06:42 +0000
From:   "Russell King (Oracle)" <linux@...linux.org.uk>
To:     Hui Tang <tanghui20@...wei.com>
Cc:     linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
        Jens Axboe <axboe@...nel.dk>
Subject: Re: [bug-report] possible performance problem in ret_to_user_from_irq

On Mon, Dec 26, 2022 at 04:45:20PM +0800, Hui Tang wrote:
> 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?

I think it should be fine - but I would suggest re-organising the
TIF definitions so that those TIF bits that shouldn't trigger
do_work_pending are not in the first 16 bits.

Note that all four bits in _TIF_SYSCALL_WORK need to stay within
an 8-bit even-bit-aligned range, so the value is suitable for an
immediate assembly constant.

I'd suggest moving the TIF definitions for 20 to 19, and 4..7 to
20..23, and then 8 to 4.

Thanks.

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ