mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Wiring down Pages
@ 2000-12-21 19:46 Sourav Sen
  2000-12-21 20:46 ` Rik van Riel
  0 siblings, 1 reply; 4+ messages in thread
From: Sourav Sen @ 2000-12-21 19:46 UTC (permalink / raw)
  To: linux-kernel


Hi,
	I am a novice in this exciting kernel world, so
my questions may be a bit naive, please bear with me.(I am student at
IISc, Bangalore).

	Suppose I want to wire-down( as they call in BSD ) a page in
memory, how I go about doing that? (I guess by setting the PG_locked bit
of the flags field in the struct page, I can do it, am I right?)

sourav
--------------------------------------------------------------------------------
SOURAV SEN    MSc(Engg.) CSA IISc BANGALORE URL : www2.csa.iisc.ernet.in/~sourav 
ROOM NO : N-78      TEL :(080)309-2454(HOSTEL)          (080)309-2906 (COMP LAB) 
--------------------------------------------------------------------------------


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Wiring down Pages
  2000-12-21 19:46 Wiring down Pages Sourav Sen
@ 2000-12-21 20:46 ` Rik van Riel
  2000-12-21 23:08   ` Robert Read
  0 siblings, 1 reply; 4+ messages in thread
From: Rik van Riel @ 2000-12-21 20:46 UTC (permalink / raw)
  To: Sourav Sen; +Cc: linux-kernel

On Fri, 22 Dec 2000, Sourav Sen wrote:

> 	Suppose I want to wire-down( as they call in BSD ) a page
> in memory, how I go about doing that? (I guess by setting the
> PG_locked bit of the flags field in the struct page, I can do
> it, am I right?)

Linux simply uses page->count for this. By using the page->count,
multiple parts of the kernel can pin the same page in memory at
different times and unlock them at different times without any
locking/unlocking conflicts...

page_cache_get(page);  <= increases page->count

<your critical stuff here>

page_cache_drop(page); <= removes your extra count

regards,

Rik
--
Hollywood goes for world dumbination,
	Trailer at 11.

		http://www.surriel.com/
http://www.conectiva.com/	http://distro.conectiva.com.br/

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Wiring down Pages
  2000-12-21 20:46 ` Rik van Riel
@ 2000-12-21 23:08   ` Robert Read
  2000-12-22 11:24     ` Rik van Riel
  0 siblings, 1 reply; 4+ messages in thread
From: Robert Read @ 2000-12-21 23:08 UTC (permalink / raw)
  To: Rik van Riel; +Cc: Sourav Sen, linux-kernel

On Thu, Dec 21, 2000 at 06:46:33PM -0200, Rik van Riel wrote:
> 
> page_cache_drop(page); <= removes your extra count

I can't find that function, do you mean page_cache_free() and
page_cache_release(), both are aliases for __free_page(). Maybe we
need another alias. :)

Should non-page cache related code use get_page() and __free_page()
directly?  Or should the page_cache_* macros be used everywhere?

robert
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Wiring down Pages
  2000-12-21 23:08   ` Robert Read
@ 2000-12-22 11:24     ` Rik van Riel
  0 siblings, 0 replies; 4+ messages in thread
From: Rik van Riel @ 2000-12-22 11:24 UTC (permalink / raw)
  To: Robert Read; +Cc: Sourav Sen, linux-kernel

On Thu, 21 Dec 2000, Robert Read wrote:
> On Thu, Dec 21, 2000 at 06:46:33PM -0200, Rik van Riel wrote:
> > 
> > page_cache_drop(page); <= removes your extra count
> 
> I can't find that function, do you mean page_cache_free() and
> page_cache_release(), both are aliases for __free_page(). Maybe
> we need another alias. :)

page_cache_release(), indeed. My bad...

> Should non-page cache related code use get_page() and
> __free_page() directly?  Or should the page_cache_* macros be
> used everywhere?

The non-page cache related code should use get_page() and
__free_page() (put_page?) directly. There may come a day
where the pagecache page size can be different from the
page size ...

regards,

Rik
--
Hollywood goes for world dumbination,
	Trailer at 11.

		http://www.surriel.com/
http://www.conectiva.com/	http://distro.conectiva.com.br/


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2000-12-22 11:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-12-21 19:46 Wiring down Pages Sourav Sen
2000-12-21 20:46 ` Rik van Riel
2000-12-21 23:08   ` Robert Read
2000-12-22 11:24     ` Rik van Riel

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®