mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Gérard Roudier" <groudier@free.fr>
To: Troy Benjegerdes <hozer@drgw.net>
Cc: "David S. Miller" <davem@redhat.com>,
	<linux-kernel@vger.kernel.org>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>,
	Russell King <rmk@arm.linux.org.uk>,
	Dan Malek <dan@embeddededge.com>, <mattl@mvista.com>
Subject: Re: pci_alloc_consistent from interrupt == BAD
Date: Fri, 18 Jan 2002 21:21:35 +0100 (CET)	[thread overview]
Message-ID: <20020118210150.Q1937-100000@gerard> (raw)
In-Reply-To: <20020118130209.J14725@altus.drgw.net>



On Fri, 18 Jan 2002, Troy Benjegerdes wrote:

> Somehow the docs in DMA-mappings.txt say pci_alloc_consistent is allowed from
> interrupt, but this is a "bad thing" on at least arm and PPC non-cache
> coherent cpus.

Everything gets bad when it doesn't work for you. :-)

> On these cpus we have to allocate page tables for consistent_alloc.. I really
> dont' think we want to be doing this during interrupt context.
>
> This also causes the sym53c8xx_2 driver to not work on some embedded ppc 4xx
> boards, and in general, seems to be a 'bad thing' to allow.

I have noted that some ports may [ever] require pci_alloc_consistent not
to be called from interrupt context. Just I will look into this when time
will allow.

Btw, I thought long ago about using a thread in the driver to deal with
completions and some other events on which the driver may want to allocate
memory. But this would have added useless latency. Instead I preferred to
be careful about the driver to be as fast as possible when completing an
IO under interrupt.

Btw-bis, FreeBSD-5 wants to thread everything (as most of you know). We
will see the result... No need to say that I posted my disagreement when
this project started. As FreeBSD-5 should be ready when Linux-2.6 will be,
we will be able to compare interrupt threading cost against simple fast
interrupt on typical hardware (99% are UP in my guessing).

> For example, in the arch/arm/consistent.c:
>
> /*
>  * This allocates one page of cache-coherent memory space and returns
>  * both the virtual and a "dma" address to that space.  It is not clear
>  * whether this could be called from an interrupt context or not.  For
>  * now, we expressly forbid it, especially as some of the stuff we do
>  * here is not interrupt context safe.
>  *
>  * Note that this does *not* zero the allocated area!
>  */
> void *consistent_alloc(int gfp, size_t size, dma_addr_t *dma_handle)
>
> (arm's pci_alloc_consistent always calls consistent_alloc).

ARM arch is simplistic. Wanting to run modern O/Ses on this crap looks
utter stupidity to me. I don't care about ARM at all.

> The PPC version calls a similiar function when CONFIG_NOT_COHERENT_CACHE is
> defined. On 'regular' ppc machines, it's just a __get_free_pages, which is
> why no one from the pmac crowd has screamed.

I am not going to ever use not cache coherent hardware, even if I am ready
to make the sym driver work reliably on such brain-dead things. Just it is
not high priority stuff for now.

  Gérard.


  parent reply	other threads:[~2002-01-18 20:23 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.1011386221.24072.linux-kernel2news@redhat.com>
2002-01-18 19:02 ` Troy Benjegerdes
2002-01-18 19:22   ` Dan Malek
2002-01-18 20:50     ` Gérard Roudier
2002-01-21 23:52     ` Pete Zaitcev
2002-01-18 20:21   ` Gérard Roudier [this message]
2002-01-18 20:32   ` David S. Miller
2002-01-18 21:29     ` Russell King
2002-01-18 21:46       ` Dan Malek
2002-01-18 21:55         ` Russell King
2002-01-18 22:13           ` Dan Malek
2002-01-18 21:33     ` David S. Miller
2002-01-18 21:42       ` Russell King
2002-01-18 21:43     ` Dan Malek
2002-01-18 20:38   ` David S. Miller
2002-01-18 21:07     ` Gérard Roudier
2002-01-18 21:13     ` David S. Miller
2002-01-22  0:08 ` David S. Miller
2002-01-22  0:20   ` Pete Zaitcev
2002-01-19 17:21 David Brownell

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=20020118210150.Q1937-100000@gerard \
    --to=groudier@free.fr \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=dan@embeddededge.com \
    --cc=davem@redhat.com \
    --cc=hozer@drgw.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mattl@mvista.com \
    --cc=rmk@arm.linux.org.uk \
    /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®