[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191220202346.GT2827@hirez.programming.kicks-ass.net>
Date: Fri, 20 Dec 2019 21:23:46 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Alexey Brodkin <Alexey.Brodkin@...opsys.com>
Cc: Robin Murphy <robin.murphy@....com>,
Marc Gonzalez <marc.w.gonzalez@...e.fr>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Rafael Wysocki <rjw@...ysocki.net>,
LKML <linux-kernel@...r.kernel.org>,
Linux ARM <linux-arm-kernel@...ts.infradead.org>,
Dmitry Torokhov <dmitry.torokhov@...il.com>,
Will Deacon <will@...nel.org>,
Russell King <rmk+kernel@...linux.org.uk>,
Bjorn Andersson <bjorn.andersson@...aro.org>,
Tejun Heo <tj@...nel.org>, Mark Brown <broonie@...nel.org>,
arcml <linux-snps-arc@...ts.infradead.org>,
Vineet Gupta <Vineet.Gupta1@...opsys.com>,
Eugeniy Paltsev <Eugeniy.Paltsev@...opsys.com>
Subject: Re: [RFC PATCH v1] devres: align devres.data strictly only for
devm_kmalloc()
On Fri, Dec 20, 2019 at 07:32:16PM +0000, Alexey Brodkin wrote:
> Well it somehow used to work for quite some time now with the data-buffer
> being allocated with 4 words offset (which is 16 bytes for 32-bit platform
3 words, devres_node is 3 words.
Which is exactly why we had to change it, the odd alignment caused ARC
to explode.
> and 32 for 64-bit which is still much less than mentioned 128 bytes).
> Or we just never managed to identify those rare cases when data corruption
> really happened?
The races are rather rare methinks, you'd have to get a list-op
concurrently with a DMA.
If you get the list corrupted, I'm thinking the crash is fairly likely,
albeit really difficuly to debug.
> > No matter which way round you allocate devres and data, by necessity
> > they're always going to consume the same total amount of memory.
>
> So then the next option I guess is to separate meta-data from data buffers
> completely. Are there any reasons to not do that
Dunno, should work just fine I think.
> other than the hack we're
> discussing here (meta-data in the beginning of the buffer) used to work OK-ish?
If meta-data at the beginngin used to work, I don't see why meta-data at
the end wouldn't work equally well. They'd be equally broken.
But I'm still flabbergasted at the fact that they're doing non-coherent
DMA to kmalloc memory, I thought we had a DMA api for that, with a
special allocator and everything (but what do I know, I've never used
that).
Powered by blists - more mailing lists