All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Hellstrom <thomas@shipmail.org>
To: Dave Airlie <airlied@gmail.com>
Cc: Jerome Glisse <jglisse@redhat.com>, dri-devel@lists.sf.net
Subject: Re: [PATCH 05/13] drm/ttm: ttm_fault callback to allow driver to handle bo placement V5
Date: Fri, 09 Apr 2010 14:39:53 +0200	[thread overview]
Message-ID: <4BBF2019.7040100@shipmail.org> (raw)
In-Reply-To: <h2p21d7e9971004081941qa7f2de77z15311ef164b3748f@mail.gmail.com>

Dave Airlie wrote:
> On Wed, Apr 7, 2010 at 8:21 PM, Jerome Glisse <jglisse@redhat.com> wrote:
>   
>> On fault the driver is given the opportunity to perform any operation
>> it sees fit in order to place the buffer into a CPU visible area of
>> memory. This patch doesn't break TTM users, nouveau, vmwgfx and radeon
>> should keep working properly. Future patch will take advantage of this
>> infrastructure and remove the old path from TTM once driver are
>> converted.
>>
>> V2 return VM_FAULT_NOPAGE if callback return -EBUSY or -ERESTARTSYS
>> V3 balance io_mem_reserve and io_mem_free call, fault_reserve_notify
>>   is responsible to perform any necessary task for mapping to succeed
>> V4 minor cleanup, atomic_t -> bool as member is protected by reserve
>>   mecanism from concurent access
>> V5 the callback is now responsible for iomapping the bo and providing
>>   a virtual address this simplify TTM and will allow to get rid of
>>   TTM_MEMTYPE_FLAG_NEEDS_IOREMAP
>>     
>
> Okay I've applied all these to drm-next and it fails to run X for longer than
> 5 mins on my 32-bit machine.
>
> The whole IO reserve thing looks like a bad idea for anything but kmap,
> since it ioremap's the pages, but we have limited ioremap space on 32-bit,
> and you hit that and vmallocs all start failing soon after.
>
>   
>> -       ret = ttm_bo_pci_offset(bdev, &bo->mem, &bus_base, &bus_offset,
>> -                               &bus_size);
>> -       if (unlikely(ret != 0)) {
>> +       ret = ttm_mem_io_reserve(bdev, &bo->mem);
>> +       if (ret) {
>>                retval = VM_FAULT_SIGBUS;
>>                goto out_unlock;
>>        }
>>     
>
> This is the start of the insanity, since ever bo that takes a
> userspace pagefault
> ends up using ioremap space for *no* reason whatsoever at all. You only need
> to use ioremap space if the *kernel* is accessing the bo not if userspace is,
> so really only in the kmap space.
>
> I've dropped it all from drm-next until you can resolve this.
>
> Dave.
>   

Indeed, ttm_mem_io_reserve() shouldn't do anything like that. It should 
place the bo data in a mappable region. If there is a copy involving 
ioremap() to do so, it should be iounmapped() before the operation is 
finished.

Thomas



------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
--

      reply	other threads:[~2010-04-09 12:39 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-07 10:21 unmappable vram V7 Jerome Glisse
2010-04-07 10:21 ` [PATCH 01/13] drm/ttm: split no_wait argument in 2 GPU or reserve wait Jerome Glisse
2010-04-07 10:21   ` [PATCH 02/13] drm/radeon/kms: update to TTM no_wait splitted argument Jerome Glisse
2010-04-07 10:21     ` [PATCH 03/13] drm/nouveau: " Jerome Glisse
2010-04-07 10:21       ` [PATCH 04/13] drm/vmwgfx: " Jerome Glisse
2010-04-07 10:21         ` [PATCH 05/13] drm/ttm: ttm_fault callback to allow driver to handle bo placement V5 Jerome Glisse
2010-04-07 10:21           ` [PATCH 06/13] drm/radeon/kms: add support for new fault callback V6 Jerome Glisse
2010-04-07 10:21             ` [PATCH 07/13] drm/nouveau/kms: add support for new TTM fault callback V4 Jerome Glisse
2010-04-07 10:21               ` [PATCH 08/13] drm/vmwgfx: " Jerome Glisse
2010-04-07 10:21                 ` [PATCH 09/13] drm/radeon/kms: don't initialize TTM io memory manager field Jerome Glisse
2010-04-07 10:21                   ` [PATCH 10/13] drm/nouveau/kms: " Jerome Glisse
2010-04-07 10:21                     ` [PATCH 11/13] drm/vmwgfx: " Jerome Glisse
2010-04-07 10:21                       ` [PATCH 12/13] drm/ttm: remove io_ field from TTM V5 Jerome Glisse
2010-04-07 10:21                         ` [PATCH 13/13] drm/radeon/kms: enable use of unmappable VRAM V2 Jerome Glisse
2010-04-09  2:41           ` [PATCH 05/13] drm/ttm: ttm_fault callback to allow driver to handle bo placement V5 Dave Airlie
2010-04-09 12:39             ` Thomas Hellstrom [this message]

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=4BBF2019.7040100@shipmail.org \
    --to=thomas@shipmail.org \
    --cc=airlied@gmail.com \
    --cc=dri-devel@lists.sf.net \
    --cc=jglisse@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.