tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: UVM typedef struct



Hi!

Sort answer:

I strongly support "typedef struct vm_page *vm_page_t".

Long answer:

I've been looking deeply into UVM pager and the fault routine.  I plan
to extend pagers to handle not only page cache but also non-cache
page, that is memory-mappable, directly-accessible page, like
character devices or NAND FlashROM.  To achieve this, I want pagers to
return a magic (struct vm_page *) to tell callers that "there is no
(struct vm_page *) object; we tell you my physical address other
way!".  Here (struct vm_page *) is actually a magic uintptr_t.

I think that there're many benefits by making struct vm_page opaque.
Its content is touched from ~everywhere including filesystem layers,
which violates abstraction.  I'd propose to make vm_page_t opaque and
make users to always use accessor routines.

If once vm_page_t internal is hidden, page handling would be much
extensible - locking improvements, accounting, or variable sized
pages, etc.

Masao


Home | Main Index | Thread Index | Old Index