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]
Date:   Wed, 3 Feb 2021 21:42:42 +0100
From:   Pavel Machek <pavel@....cz>
To:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:     linux-kernel@...r.kernel.org, stable@...r.kernel.org,
        Johannes Berg <johannes.berg@...el.com>,
        Luca Coelho <luciano.coelho@...el.com>,
        Kalle Valo <kvalo@...eaurora.org>,
        Sasha Levin <sashal@...nel.org>
Subject: Re: [PATCH 4.19 26/37] iwlwifi: pcie: use jiffies for memory read
 spin time limit

Hi!

> From: Johannes Berg <johannes.berg@...el.com>
> 
> [ Upstream commit 6701317476bbfb1f341aa935ddf75eb73af784f9 ]
> 
> There's no reason to use ktime_get() since we don't need any better
> precision than jiffies, and since we no longer disable interrupts
> around this code (when grabbing NIC access), jiffies will work fine.
> Use jiffies instead of ktime_get().
> 
> This cleanup is preparation for the following patch "iwlwifi: pcie: reschedule
> in long-running memory reads". The code gets simpler with the weird clock use
> etc. removed before we add cond_resched().

As far as I can tell, this is not really suitable for v4.19 (and
probably others), as we still disable interrupts in
iwl_trans_pcie_release_nic_access() in 4.19.

Best regards,
								Pavel
								

> @@ -2137,11 +2137,7 @@ static int iwl_trans_pcie_read_mem(struct iwl_trans *trans, u32 addr,
>  							HBUS_TARG_MEM_RDAT);
>  				offs++;
>  
> -				/* calling ktime_get is expensive so
> -				 * do it once in 128 reads
> -				 */
> -				if (offs % 128 == 0 && ktime_after(ktime_get(),
> -								   timeout))
> +				if (time_after(jiffies, end))
>  					break;
>  			}
>  			iwl_trans_release_nic_access(trans, &flags);

-- 
http://www.livejournal.com/~pavelmachek

Download attachment "signature.asc" of type "application/pgp-signature" (182 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ