mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Dave Airlie <airlied@gmail.com>
Cc: Keith Packard <keithp@keithp.com>, Dave Airlie <airlied@linux.ie>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Nick Piggin <nickpiggin@yahoo.com.au>
Subject: Re: kmap_atomic_pfn for PCI BAR access?
Date: Wed, 25 Jun 2008 20:11:05 -0700	[thread overview]
Message-ID: <486308C9.5070709@goop.org> (raw)
In-Reply-To: <21d7e9970806251823q3405e192q13d4944bd0cc3291@mail.gmail.com>

Dave Airlie wrote:
> On Thu, Jun 26, 2008 at 11:18 AM, Jeremy Fitzhardinge <jeremy@goop.org> wrote:
>   
>> Keith Packard wrote:
>>     
>>> The graphics memory BAR is generally fairly good sized; on Intel chips,
>>> it's between 256M and 1G (and growing). I want to write data into this
>>> region from kernel space, but it's really too big to map the whole thing
>>> into kernel address space, especially on 32-bit systems. ioremap is not
>>> a good option here -- it's way too slow.
>>>
>>> With CONFIG_HIGHMEM enabled, I can use kmap_atomic_pfn (well, actually
>>> the kmap_atomic_proc_pfn included in the DRM tree) and things work quite
>>> well -- performance is good, with barely any measurable time spent in
>>> the PTE whacking (~1%).
>>>
>>> However, with CONFIG_HIGHMEM disabled, there aren't any PTEs reserved
>>> for this kind of mapping fun. This makes me suspect that abusing
>>> kmap_atomic for this operation would not be appreciated.
>>> Should I use kmap_atomic_pfn to reach my PCI BAR like this?
>>>
>>> Would it be reasonable to supply a patch that made this work even
>>> without CONFIG_HIGHMEM?
>>>
>>>       
>> Usually people use ioremap to map device memory.  Wouldn't that work in this
>> case?
>>
>>     
>
> "but it's really too big to map the whole thing
> into kernel address space, especially on 32-bit systems. ioremap is not
> a good option here -- it's way too slow."
>
> From the original mail.
>   

Uh, yep.

> doing tlb flush for iounmap is slow as all hell if you do it a lot,
> and we can't afford to mmap the whole aperture it can 1GB.
>   

Maybe Nick's vmap reimplementation would help here.  It effectively 
allows you to map stuff into the vmalloc space, and do lazy tlb flushes 
to mitigate the cost of map/unmap.  He posted the patches week or so ago.

    J

  reply	other threads:[~2008-06-26  3:11 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-23 17:34 Keith Packard
2008-06-26  1:18 ` Jeremy Fitzhardinge
2008-06-26  1:23   ` Dave Airlie
2008-06-26  3:11     ` Jeremy Fitzhardinge [this message]
2008-07-07  6:53       ` Nick Piggin
2008-07-07  7:05         ` Arjan van de Ven
2008-07-07 11:19           ` Nick Piggin
2008-06-26  4:36     ` Arjan van de Ven
2008-06-26  5:02       ` Dave Airlie
2008-06-26  5:33         ` Keith Packard
2008-06-26  5:36       ` Keith Packard
2008-06-26  5:59         ` Jeremy Fitzhardinge
2008-06-26  6:02           ` Dave Airlie
2008-06-26 10:36             ` Arjan van de Ven
2008-06-26 13:02               ` Arjan van de Ven
2008-06-26 10:34         ` Arjan van de Ven

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=486308C9.5070709@goop.org \
    --to=jeremy@goop.org \
    --cc=airlied@gmail.com \
    --cc=airlied@linux.ie \
    --cc=keithp@keithp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nickpiggin@yahoo.com.au \
    /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®