All of lore.kernel.org
 help / color / mirror / Atom feed
From: Micha Nelissen <micha@neli.hopto.org>
To: linux-kernel@vger.kernel.org
Subject: get_user_pages + put_task_struct
Date: Fri, 06 May 2011 22:35:47 +0200	[thread overview]
Message-ID: <4DC45BA3.7@neli.hopto.org> (raw)

Hi,

I am writing a (pci) device driver, in which I'm doing userspace DMA 
with get_user_pages. After some complicated locking, it occurred to me 
to use reference counting instead, after finding the functions 
get_task_mm and get_task_struct. However, put_task_struct cannot be used 
in a module, linker will complain about __put_task_struct_cb being 
undefined. I saw it explicitly being removed as a symbol, "we do not 
want device drivers holding references to task structs". Why exactly is 
this?

mmput is exported, so no problem for the mm. BTW, I'm also not exactly 
sure why I (conceptually) need a task to get the pages; but I think it's 
for statistics.

I need to hold on to this task because the DMA transaction may need to 
be split in multiple pieces, continuing after the initial call by the 
user; during which time that process may have exited (e.g. unexpected kill).

Micha

                 reply	other threads:[~2011-05-06 20:46 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=4DC45BA3.7@neli.hopto.org \
    --to=micha@neli.hopto.org \
    --cc=linux-kernel@vger.kernel.org \
    /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.