RE: error message for invalid mapping?
"Kevin Elphinstone" <[email protected]>
| Newsgroups | gmane.comp.micro-kernel.l4.l4ka.general |
|---|---|
| Message-ID | <001e01c6d623$595ec3e0$3ca18fcb@mako> |
> >
> > > 1. make the IPC fail?
> >
> > No. Trying to map a non-existent page is a legal operation.
>
> If it is a legal operation, then why does it not complete? But
> perhaps you mean that it is legal in the sense that the IPC itself
> completes successfully? If that is the case, I can see the argument
> for not making the IPC fail.
>
>
The issue is a little more subtle. There are instances of systems
where pagers themselves are paged. In this case the knowledge of
whether a mapping succeeded or not is "less informative". Yes, it was
thought about.
To illustrate, assume pager A pages pager B which pages client C. If
pager B sends a mapping to C, whether it succeeds or not is dependent
on A, if pager A is paging pager B, then a bit indicating "mapping
successful" means very little, the successful mapping (B->C)can be
removed by A before B even inspects the status bit.
The trade-off currently is towards transparent paging (i.e. paging a
paged-out page "succeeds"), at the expense of debug-ability as you
have seen. That said, the two general design patterns for pagers are:
1. Have a "contract" with your pager (A in this case) to supply memory
with known properties. In this case, the indication bit would be
useful if one the properties in the contract is "pinned"
2. Read the first word of a page prior to sending the mapping which
works in either case where the B's page is paged (i.e. maximise the
probability the mapping will be performed) or pinned (which would
provide an unexpected page fault in the situation you tried to
debug).
Anyway, I don't wish to be drawn into what is "correct" behaviour by
somebodies definition of "correct", I just wanted to explain the reason
behind the current behaviour.
I'll leave it to the list to debate the merits/utility of system
design patterns (different systems use different patterns, so I'm not
expecting consensus here :-)).
- Kevin