linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Phillips <phillips@bonn-fries.net>
To: Michael Heinz <mheinz@infiniconsys.com>, linux-kernel@vger.kernel.org
Subject: Re: Implications of PG_locked and reference count in page structures....
Date: Wed, 15 Aug 2001 19:04:16 +0200	[thread overview]
Message-ID: <20010815165752Z16225-1232+354@humbolt.nl.linux.org> (raw)
In-Reply-To: <3B7A97C5.9090207@infiniconsys.com>
In-Reply-To: <3B7A97C5.9090207@infiniconsys.com>

On August 15, 2001 05:39 pm, Michael Heinz wrote:
> I'm in the process of porting a driver to Linux. The author of the 
> driver conveniently broke it into os-dependent and independent sections.
> 
> One of the things in the "OS" dependent section is a routine to lock a 
> section of memory presumably to be used for DMA.
> 
> So, what I want to do is this: given a pointer to a previously 
> kmalloc'ed block, and the length of that block, I want to (a) identify 
> each page associated with the block and (b) lock each page. It appears 
> that I can lock the page either by incrementing it's reference count, or 
> by setting the PG_locked flag for the page.
> 
> Which method is preferred? Is there another method I should be using 
> instead?

See the other replies - you do not need to memlock your pages because you
will be allocating non-pageable kernel memory.

But for future reference, PG_locked is for serializing IO/cache
operations.  You use the page reference count to prevent a page from
being freed, i.e., to memlock it.  You'll see such object ref-counting
schemes showing up all through the kernel in slight variations.

--
Daniel

  parent reply	other threads:[~2001-08-15 16:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-15 15:39 Implications of PG_locked and reference count in page structures Michael Heinz
2001-08-15 16:04 ` Ignacio Vazquez-Abrams
2001-08-15 17:04 ` Daniel Phillips [this message]
     [not found] <no.id>
2001-08-15 15:55 ` Alan Cox
2001-08-15 17:10 Heinz, Michael

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=20010815165752Z16225-1232+354@humbolt.nl.linux.org \
    --to=phillips@bonn-fries.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mheinz@infiniconsys.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).