[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKgNAkhx2trGUMCbpYbKbMYYjq9oTeAnqG436_MP2t6noA3K-g@mail.gmail.com>
Date: Thu, 18 Oct 2012 12:13:23 +0200
From: "Michael Kerrisk (man-pages)" <mtk.manpages@...il.com>
To: Dan Carpenter <dan.carpenter@...cle.com>
Cc: Shuah Khan <shuah.khan@...com>,
Andrew Morton <akpm@...ux-foundation.org>,
konrad.wilk@...cle.com, rob@...dley.net, joerg.roedel@....com,
shuahkhan@...il.com, devel@...uxdriverproject.org,
linux-kernel@...r.kernel.org, linux-doc@...r.kernel.org
Subject: Re: [PATCH] Documentation DMA-API-HOWTO.txt Add dma mapping error
check usage examples
On Thu, Oct 18, 2012 at 11:47 AM, Dan Carpenter
<dan.carpenter@...cle.com> wrote:
> On Sun, Oct 14, 2012 at 09:54:24AM -0600, Shuah Khan wrote:
>> diff --git a/Documentation/DMA-API-HOWTO.txt b/Documentation/DMA-API-HOWTO.txt
>> index a0b6250..cf1adb4 100644
>> --- a/Documentation/DMA-API-HOWTO.txt
>> +++ b/Documentation/DMA-API-HOWTO.txt
>> @@ -468,11 +468,46 @@ To map a single region, you do:
>> size_t size = buffer->len;
>>
>> dma_handle = dma_map_single(dev, addr, size, direction);
>> + if (unlikely(dma_mapping_error(dma_handle))) {
>
> Don't encourage people to put unlikely() and likely() into their
> driver code. It should only be used after benchmarking both with
> and without. I can't imagine how it would make a measurable
> difference here.
(Hi Dan)
Quite. See http://blog.man7.org/2012/10/how-much-do-builtinexpect-likely-and.html
I wonder how many blind uses of likely() and unlikely() in the kernel
are actually degrading performance.
Cheers,
Michael
--
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Author of "The Linux Programming Interface"; http://man7.org/tlpi/
--
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