mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Leon Woestenberg <leon.woestenberg@gmail.com>
To: Joerg Roedel <joerg.roedel@amd.com>
Cc: Ingo Molnar <mingo@elte.hu>,
	iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 4/5] dma-debug: disable/enable irqs only once in  device_dma_allocations
Date: Thu, 23 Jul 2009 20:43:30 +0200	[thread overview]
Message-ID: <c384c5ea0907231143h696406fcu7219800e5998fa4b@mail.gmail.com> (raw)
In-Reply-To: <1244471650-4632-5-git-send-email-joerg.roedel@amd.com>

Hello,

On Mon, Jun 8, 2009 at 4:34 PM, Joerg Roedel<joerg.roedel@amd.com> wrote:
> There is no need to disable/enable irqs on each loop iteration. Just
> disable irqs for the whole time the loop runs.
>
A typical need would be low interrupt latency.


> Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
> ---
>  lib/dma-debug.c |    8 ++++++--
>  1 files changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/lib/dma-debug.c b/lib/dma-debug.c
> index 24c4a2c..27b369d 100644
> --- a/lib/dma-debug.c
> +++ b/lib/dma-debug.c
> @@ -649,15 +649,19 @@ static int device_dma_allocations(struct device *dev)
>        unsigned long flags;
>        int count = 0, i;
>
> +       local_irq_save(flags);
> +
>        for (i = 0; i < HASH_SIZE; ++i) {
> -               spin_lock_irqsave(&dma_entry_hash[i].lock, flags);
> +               spin_lock(&dma_entry_hash[i].lock);
>                list_for_each_entry(entry, &dma_entry_hash[i].list, list) {
>                        if (entry->dev == dev)
>                                count += 1;
>                }
> -               spin_unlock_irqrestore(&dma_entry_hash[i].lock, flags);
> +               spin_unlock(&dma_entry_hash[i].lock);
>        }
>
> +       local_irq_restore(flags);
> +
>        return count;
>  }

Does this mean that on a UP system, interrupts are disabled for O(HASH_SIZE)?
How would that affect interrupt latencies?

Regards,
-- 
Leon

  reply	other threads:[~2009-07-23 18:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-08 14:34 [git pull][PATCH 0/5] dma-debug minor fixes and cleanups Joerg Roedel
2009-06-08 14:34 ` [PATCH 1/5] dma-debug: comment style fixes Joerg Roedel
2009-06-08 14:34 ` [PATCH 2/5] dma-debug: code " Joerg Roedel
2009-06-08 14:34 ` [PATCH 3/5] dma-debug: use pr_* instead of printk(KERN_* ...) Joerg Roedel
2009-06-08 14:34 ` [PATCH 4/5] dma-debug: disable/enable irqs only once in device_dma_allocations Joerg Roedel
2009-07-23 18:43   ` Leon Woestenberg [this message]
2009-06-08 14:34 ` [PATCH 5/5] dma-debug: simplify logic in driver_filter() Joerg Roedel
2009-06-08 15:29 ` [git pull][PATCH 0/5] dma-debug minor fixes and cleanups Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c384c5ea0907231143h696406fcu7219800e5998fa4b@mail.gmail.com \
    --to=leon.woestenberg@gmail.com \
    --cc=iommu@lists.linux-foundation.org \
    --cc=joerg.roedel@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®