lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <c384c5ea0907231143h696406fcu7219800e5998fa4b@mail.gmail.com>
Date:	Thu, 23 Jul 2009 20:43:30 +0200
From:	Leon Woestenberg <leon.woestenberg@...il.com>
To:	Joerg Roedel <joerg.roedel@....com>
Cc:	Ingo Molnar <mingo@...e.hu>, iommu@...ts.linux-foundation.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 4/5] dma-debug: disable/enable irqs only once in 
	device_dma_allocations

Hello,

On Mon, Jun 8, 2009 at 4:34 PM, Joerg Roedel<joerg.roedel@....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@....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
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ