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: <bc7affce-e38a-1800-843d-a739884008f6@linaro.org>
Date:   Thu, 22 Jun 2017 16:55:36 +0200
From:   Daniel Lezcano <daniel.lezcano@...aro.org>
To:     Thomas Gleixner <tglx@...utronix.de>
Cc:     linux-kernel@...r.kernel.org,
        Peter Zijlstra <peterz@...radead.org>,
        "Rafael J . Wysocki" <rafael@...nel.org>,
        Vincent Guittot <vincent.guittot@...aro.org>,
        Nicolas Pitre <nicolas.pitre@...aro.org>,
        Hannes Reinecke <hare@...e.com>, Jens Axboe <axboe@...nel.dk>,
        Bjorn Helgaas <bhelgaas@...gle.com>
Subject: Re: [PATCH 2/3] irq: Track the interrupt timings


Hi Thomas,

thanks for the review.

On 22/06/2017 16:47, Thomas Gleixner wrote:
> On Tue, 20 Jun 2017, Daniel Lezcano wrote:
>> +
>> +struct irq_timings {
>> +	u64 values[IRQ_TIMINGS_SIZE]; /* our circular buffer */
>> +	unsigned int count; /* Number of interruptions since last inspection */
> 
> Groan. These tail comments are horrible.
> 
> Please make the struct member names tabular aligned and add proper kernel
> doc comments if you want to add useful documentations for the fields.

[ ... ]

Ok.

>> + * The interrupt number and the timestamp are encoded into a single
>> + * u64 variable to optimize the size.
>> + * 48 bit time stamp and 16 bit IRQ number is way sufficient.
>> + *  Who cares an IRQ after 78 hours of idle time?
>> + */
>> +static inline u64 irq_timing_encode(u64 timestamp, int irq)
>> +{
>> +	return (timestamp << 16) | irq;
>> +}
>> +
>> +static inline void irq_timing_decode(u64 value, u64 *timestamp, int *irq)
> 
> What's wrong with using a return value instead of void?

Nothing wrong, as we are expecting two values I don't like the idea to
have one returned and the other one passed as a pointer. It is a matter
of taste. I can return the irq if you prefer.




-- 
 <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ