All of lore.kernel.org
 help / color / mirror / Atom feed
* [ath9k-devel] ath9k-rng: high cpu load
@ 2016-03-04 15:21 Oleksij Rempel
  2016-03-11  9:46 ` miaoqing at codeaurora.org
  0 siblings, 1 reply; 4+ messages in thread
From: Oleksij Rempel @ 2016-03-04 15:21 UTC (permalink / raw)
  To: ath9k-devel

Hallo all,

on my last train trip i noticed that ath9k-rng produce continuous 15%
cpu load. Probably two factor coused this issue:
- my STA was not associated with any AP
- on the road there is enough noise.

from why i see, this code has all reasons to consume all CPU time it
get, so far ath9k_rng_data_read can provide some data.

        while (!kthread_should_stop()) {
                bytes_read = ath9k_rng_data_read(sc, rng_buf,
                                                 ATH9K_RNG_BUF_SIZE);
                if (unlikely(!bytes_read)) {
                        msleep_interruptible(10);
                        continue;
                }

                /* sleep until entropy bits under write_wakeup_threshold */
                add_hwgenerator_randomness((void *)rng_buf, bytes_read,
                                           ATH9K_RNG_ENTROPY(bytes_read));
        }

-- 
Regards,
Oleksij

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 213 bytes
Desc: OpenPGP digital signature
Url : http://lists.ath9k.org/pipermail/ath9k-devel/attachments/20160304/27b4bff4/attachment.pgp 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [ath9k-devel] ath9k-rng: high cpu load
  2016-03-04 15:21 [ath9k-devel] ath9k-rng: high cpu load Oleksij Rempel
@ 2016-03-11  9:46 ` miaoqing at codeaurora.org
  2016-03-14 14:47   ` Oleksij Rempel
  0 siblings, 1 reply; 4+ messages in thread
From: miaoqing at codeaurora.org @ 2016-03-11  9:46 UTC (permalink / raw)
  To: ath9k-devel

Hi Oleksij,

Please try the attached patch. No valid ADC randomness will cause the issue.

--
Regards,
Miaoqing


> Hallo all,
>
> on my last train trip i noticed that ath9k-rng produce continuous 15%
> cpu load. Probably two factor coused this issue:
> - my STA was not associated with any AP
> - on the road there is enough noise.
>
> from why i see, this code has all reasons to consume all CPU time it
> get, so far ath9k_rng_data_read can provide some data.
>
>         while (!kthread_should_stop()) {
>                 bytes_read = ath9k_rng_data_read(sc, rng_buf,
>                                                  ATH9K_RNG_BUF_SIZE);
>                 if (unlikely(!bytes_read)) {
>                         msleep_interruptible(10);
>                         continue;
>                 }
>
>                 /* sleep until entropy bits under write_wakeup_threshold
> */
>                 add_hwgenerator_randomness((void *)rng_buf, bytes_read,
>                                            ATH9K_RNG_ENTROPY(bytes_read));
>         }
>
> --
> Regards,
> Oleksij
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-ath9k-fix-rng-high-cpu-load.patch
Type: text/x-diff
Size: 0 bytes
Desc: not available
Url : http://lists.ath9k.org/pipermail/ath9k-devel/attachments/20160311/368c945e/attachment-0001.patch 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [ath9k-devel] ath9k-rng: high cpu load
  2016-03-11  9:46 ` miaoqing at codeaurora.org
@ 2016-03-14 14:47   ` Oleksij Rempel
  2016-03-14 15:14     ` Oleksij Rempel
  0 siblings, 1 reply; 4+ messages in thread
From: Oleksij Rempel @ 2016-03-14 14:47 UTC (permalink / raw)
  To: ath9k-devel

Hi, compilation is filed with:

  CC [M]  drivers/net/wireless/ath/wcn36xx/smd.o
/home/oleksij/tmp/linux/drivers/net/wireless/ath/ath9k/rng.c: In
function ?ath9k_rng_delay_get?:
/home/oleksij/tmp/linux/drivers/net/wireless/ath/ath9k/rng.c:61:3:
error: ?delay? undeclared (first use in this function)
   delay = 10;
   ^
/home/oleksij/tmp/linux/drivers/net/wireless/ath/ath9k/rng.c:61:3: note:
each undeclared identifier is reported only once for each function it
appears in
/home/oleksij/tmp/linux/drivers/net/wireless/ath/ath9k/rng.c:68:1:
warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
/home/oleksij/tmp/linux/scripts/Makefile.build:258: recipe for target
'drivers/net/wireless/ath/ath9k/rng.o' failed


Am 11.03.2016 um 10:38 schrieb miaoqing at codeaurora.org:
> Hi Oleksij,
> 
> Please try the attached patch. No valid ADC randomness will cause the issue.
> 
> --
> Regards,
> Miaoqing
> 
> 
>> Hallo all,
>>
>> on my last train trip i noticed that ath9k-rng produce continuous 15%
>> cpu load. Probably two factor coused this issue:
>> - my STA was not associated with any AP
>> - on the road there is enough noise.
>>
>> from why i see, this code has all reasons to consume all CPU time it
>> get, so far ath9k_rng_data_read can provide some data.
>>
>>         while (!kthread_should_stop()) {
>>                 bytes_read = ath9k_rng_data_read(sc, rng_buf,
>>                                                  ATH9K_RNG_BUF_SIZE);
>>                 if (unlikely(!bytes_read)) {
>>                         msleep_interruptible(10);
>>                         continue;
>>                 }
>>
>>                 /* sleep until entropy bits under write_wakeup_threshold
>> */
>>                 add_hwgenerator_randomness((void *)rng_buf, bytes_read,
>>                                            ATH9K_RNG_ENTROPY(bytes_read));
>>         }
>>
>> --
>> Regards,
>> Oleksij
>>
>>


-- 
Regards,
Oleksij

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 213 bytes
Desc: OpenPGP digital signature
Url : http://lists.ath9k.org/pipermail/ath9k-devel/attachments/20160314/db4dc053/attachment.pgp 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [ath9k-devel] ath9k-rng: high cpu load
  2016-03-14 14:47   ` Oleksij Rempel
@ 2016-03-14 15:14     ` Oleksij Rempel
  0 siblings, 0 replies; 4+ messages in thread
From: Oleksij Rempel @ 2016-03-14 15:14 UTC (permalink / raw)
  To: ath9k-devel

After fixing compilation error it looks better now.

Am 14.03.2016 um 15:47 schrieb Oleksij Rempel:
> Hi, compilation is filed with:
> 
>   CC [M]  drivers/net/wireless/ath/wcn36xx/smd.o
> /home/oleksij/tmp/linux/drivers/net/wireless/ath/ath9k/rng.c: In
> function ?ath9k_rng_delay_get?:
> /home/oleksij/tmp/linux/drivers/net/wireless/ath/ath9k/rng.c:61:3:
> error: ?delay? undeclared (first use in this function)
>    delay = 10;
>    ^
> /home/oleksij/tmp/linux/drivers/net/wireless/ath/ath9k/rng.c:61:3: note:
> each undeclared identifier is reported only once for each function it
> appears in
> /home/oleksij/tmp/linux/drivers/net/wireless/ath/ath9k/rng.c:68:1:
> warning: control reaches end of non-void function [-Wreturn-type]
>  }
>  ^
> /home/oleksij/tmp/linux/scripts/Makefile.build:258: recipe for target
> 'drivers/net/wireless/ath/ath9k/rng.o' failed
> 
> 
> Am 11.03.2016 um 10:38 schrieb miaoqing at codeaurora.org:
>> Hi Oleksij,
>>
>> Please try the attached patch. No valid ADC randomness will cause the issue.
>>
>> --
>> Regards,
>> Miaoqing
>>
>>
>>> Hallo all,
>>>
>>> on my last train trip i noticed that ath9k-rng produce continuous 15%
>>> cpu load. Probably two factor coused this issue:
>>> - my STA was not associated with any AP
>>> - on the road there is enough noise.
>>>
>>> from why i see, this code has all reasons to consume all CPU time it
>>> get, so far ath9k_rng_data_read can provide some data.
>>>
>>>         while (!kthread_should_stop()) {
>>>                 bytes_read = ath9k_rng_data_read(sc, rng_buf,
>>>                                                  ATH9K_RNG_BUF_SIZE);
>>>                 if (unlikely(!bytes_read)) {
>>>                         msleep_interruptible(10);
>>>                         continue;
>>>                 }
>>>
>>>                 /* sleep until entropy bits under write_wakeup_threshold
>>> */
>>>                 add_hwgenerator_randomness((void *)rng_buf, bytes_read,
>>>                                            ATH9K_RNG_ENTROPY(bytes_read));
>>>         }
>>>
>>> --
>>> Regards,
>>> Oleksij
>>>
>>>
> 
> 
> 
> 
> _______________________________________________
> ath9k-devel mailing list
> ath9k-devel at lists.ath9k.org
> https://lists.ath9k.org/mailman/listinfo/ath9k-devel
> 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 213 bytes
Desc: OpenPGP digital signature
Url : http://lists.ath9k.org/pipermail/ath9k-devel/attachments/20160314/f99becb1/attachment.pgp 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-03-14 15:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-04 15:21 [ath9k-devel] ath9k-rng: high cpu load Oleksij Rempel
2016-03-11  9:46 ` miaoqing at codeaurora.org
2016-03-14 14:47   ` Oleksij Rempel
2016-03-14 15:14     ` Oleksij Rempel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.