lkml.org 
[lkml]   [2019]   [Apr]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH v2 11/14] x86/watchdog/hardlockup: Add an HPET-based hardlockup detector
On Wed, Feb 27, 2019 at 08:05:15AM -0800, Ricardo Neri wrote:
> diff --git a/arch/x86/include/asm/hpet.h b/arch/x86/include/asm/hpet.h
> index 4d559e0c746f..15dc3b576496 100644
> --- a/arch/x86/include/asm/hpet.h
> +++ b/arch/x86/include/asm/hpet.h
> @@ -123,12 +123,24 @@ struct hpet_hld_data {
> u32 num;
> u32 flags;
> u64 ticks_per_second;
> + u32 handling_cpu;
> + struct cpumask cpu_monitored_mask;
> + struct msi_msg msi_msg;
> };

Please don't use struct cpumask unless you absolutely have to.

The above is better written as:


struct hpet_hld_data {
...
unsigned long cpumask[0];
};

and allocated using:

struct hpet_hld_data *hhd = kzalloc(sizeof(struct hpet_hld_data) + cpumask_size());

and used as:

to_cpumask(hhd->cpumask);

\
 
 \ /
  Last update: 2019-04-09 13:05    [W:0.245 / U:1.512 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site