From mboxrd@z Thu Jan 1 00:00:00 1970 From: erik quanstrom Date: Fri, 19 Oct 2012 11:30:39 -0400 To: 9fans@9fans.net Message-ID: <5ac1687f3033e5bc4c6a8f0896f5a974@ladd.quanstro.net> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] sheevaplug SD card driver Topicbox-Message-UUID: c0d40652-ead7-11e9-9d60-3106f5b1d025 On Fri Oct 19 10:01:11 EDT 2012, 9fans@hamnavoe.com wrote: > > could you explain the ccmalloc trick? > > "cache coherent malloc" - not really a trick, just a way to > ensure SD buffers are cache-aligned and occupy an integral > number of cache lines, to avoid embarrassment when doing > dma on ARM (which bypasses the cache). It costs a bit of > space but saves copying. that's what i thought. we ran into this problem and decided that it was easiest to just cacheline-align everything in malloc, at the obvious expense of a tiny bit of memory. the reason for this was we were using a few kw devices that could get just about any chunk of malloc'd memory. ideally we would have written a kw-specific malloc with tracking segregated from the managed memory. - erik