lkml.org 
[lkml]   [2020]   [Sep]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [RFC][Patch v1 1/3] sched/isolation: API to get num of hosekeeping CPUs
    On Wed, Sep 09, 2020 at 11:08:16AM -0400, Nitesh Narayan Lal wrote:
    > +/*
    > + * num_housekeeping_cpus() - Read the number of housekeeping CPUs.
    > + *
    > + * This function returns the number of available housekeeping CPUs
    > + * based on __num_housekeeping_cpus which is of type atomic_t
    > + * and is initialized at the time of the housekeeping setup.
    > + */
    > +unsigned int num_housekeeping_cpus(void)
    > +{
    > + unsigned int cpus;
    > +
    > + if (static_branch_unlikely(&housekeeping_overridden)) {
    > + cpus = atomic_read(&__num_housekeeping_cpus);
    > + /* We should always have at least one housekeeping CPU */
    > + BUG_ON(!cpus);
    > + return cpus;
    > + }
    > + return num_online_cpus();
    > +}
    > +EXPORT_SYMBOL_GPL(num_housekeeping_cpus);
    > +
    > int housekeeping_any_cpu(enum hk_flags flags)
    > {
    > int cpu;
    > @@ -131,6 +153,7 @@ static int __init housekeeping_setup(char *str, enum hk_flags flags)
    >
    > housekeeping_flags |= flags;
    >
    > + atomic_set(&__num_housekeeping_cpus, cpumask_weight(housekeeping_mask));

    So the problem here is that it takes the whole cpumask weight but you're only
    interested in the housekeepers who take the managed irq duties I guess
    (HK_FLAG_MANAGED_IRQ ?).

    > free_bootmem_cpumask_var(non_housekeeping_mask);
    >
    > return 1;
    > --
    > 2.27.0
    >

    \
     
     \ /
      Last update: 2020-09-22 01:41    [W:4.960 / U:0.072 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site