[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090212212511.GB2486@one.firstfloor.org>
Date: Thu, 12 Feb 2009 22:25:11 +0100
From: Andi Kleen <andi@...stfloor.org>
To: "Pallipadi, Venkatesh" <venkatesh.pallipadi@...el.com>
Cc: Andi Kleen <andi@...stfloor.org>,
"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
"mingo@...e.hu" <mingo@...e.hu>,
"tglx@...utronix.de" <tglx@...utronix.de>,
"hpa@...or.com" <hpa@...or.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] [2/4] x86: MCE: Implement dynamic machine check banks support v5
> Do we need a per cpu count of # of banks to handle one CPU having less
> banks than others case?
> Specifically, I am thinking of sequence:
> - CPU 0 has n banks
> - CPU 0 does below
> for (i = 0; i < banks; i++) {
> err = sysdev_create_file(&per_cpu(device_mce, cpu),
> &bank_attrs[i]);
> - CPU 1, which comes online later, has say n-2 banks. So, banks now becomes n-2.
> - Now whenever CPU 0 does sysdev_remove_file loop below, it will do it only for n-2 banks.
True, that would be a leak without per cpu banks count. Perhaps should take
it out, this is really not supposed to happen anyways. I'm sure
more things would break with an asymetric CPU configuration.
An alternative would be to figure out how to walk the sysfs data
structures for this, but that would be really too much effort
for something that shouldn't happen.
I think I'll just add a WARN_ON() for this case instead.
-Andi
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists