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] [day] [month] [year] [list]
Message-ID: <79dda8ce-387f-be0b-45b7-b3eb7af0d189@amd.com>
Date:   Thu, 28 Jul 2022 18:05:50 -0400
From:   Felix Kuehling <felix.kuehling@....com>
To:     Yu Zhe <yuzhe@...china.com>, alexander.deucher@....com,
        christian.koenig@....com, Xinhui.Pan@....com, airlied@...ux.ie,
        daniel@...ll.ch
Cc:     amd-gfx@...ts.freedesktop.org, dri-devel@...ts.freedesktop.org,
        linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org,
        liqiong@...china.com
Subject: Re: [PATCH v2] drm/amdkfd: use time_is_before_jiffies(a + b) to
 replace "jiffies - a > b"

Am 2022-07-27 um 23:30 schrieb Yu Zhe:
> time_is_before_jiffies deals with timer wrapping correctly.
>
> Signed-off-by: Yu Zhe <yuzhe@...china.com>

Thank you. This patch looks good to me. I'm applying it to 
amd-staging-drm-next.

Reviewed-by: Felix Kuehling <Felix.Kuehling@....com>


> ---
>   drivers/gpu/drm/amd/amdkfd/kfd_interrupt.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_interrupt.c b/drivers/gpu/drm/amd/amdkfd/kfd_interrupt.c
> index a9466d154395..34772fe74296 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_interrupt.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_interrupt.c
> @@ -146,7 +146,7 @@ static void interrupt_wq(struct work_struct *work)
>   	struct kfd_dev *dev = container_of(work, struct kfd_dev,
>   						interrupt_work);
>   	uint32_t ih_ring_entry[KFD_MAX_RING_ENTRY_SIZE];
> -	long start_jiffies = jiffies;
> +	unsigned long start_jiffies = jiffies;
>   
>   	if (dev->device_info.ih_ring_entry_size > sizeof(ih_ring_entry)) {
>   		dev_err_once(dev->adev->dev, "Ring entry too small\n");
> @@ -156,7 +156,7 @@ static void interrupt_wq(struct work_struct *work)
>   	while (dequeue_ih_ring_entry(dev, ih_ring_entry)) {
>   		dev->device_info.event_interrupt_class->interrupt_wq(dev,
>   								ih_ring_entry);
> -		if (jiffies - start_jiffies > HZ) {
> +		if (time_is_before_jiffies(start_jiffies + HZ)) {
>   			/* If we spent more than a second processing signals,
>   			 * reschedule the worker to avoid soft-lockup warnings
>   			 */

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ