Changeset 67f11a0 in mainline for kernel/generic/src/main/kinit.c


Ignore:
Timestamp:
2018-03-15T17:40:20Z (7 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
530f2de, e9e4068
Parents:
30f1a25 (diff), a36f442 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
Jakub Jermar <jakub@…> (2018-03-15 17:25:56)
git-committer:
Jakub Jermar <jakub@…> (2018-03-15 17:40:20)
Message:

Merge branch 'noreclaimers'

This commit removes the left-over from the original IPC phone life-cycle
management in which phones were freed lazily during an attempt to
allocate a new phone when the allocator found a hung-up phone with zero
active calls. This mechanism is the reason why kernel objects had to
have the reclaim method. This commit changes the behavior in that phones
are deallocated with their last reference. At the same time it makes
sure that each active call has its own reference on the phone.

This change also makes sure that each connected phone has a capability
via which it can be hung up by the user or cleaned up in ipc_cleanup().
A special mode for phone_alloc() was introduced that allows calls such
as IPC_M_CONNECT_ME_TO and IPC_M_CONNECT_TO_ME to allocate an
unpublished capability and publish it only when the phone is
successfully connected. This fixes a nasty race condition when the user
destroys the capability before the phone is connected and then this
phone becomes essentially invisible for ipc_cleanup().

Last but not least, ipc_cleanup() was slightly streamlined in that it
now knows for how many calls it has to wait from the answerbox's active
call count.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/main/kinit.c

    r30f1a25 r67f11a0  
    265265                                    PERM_IO_MANAGER | PERM_IRQ_REG);
    266266
    267                                 if (!ipc_phone_0) {
    268                                         ipc_phone_0 = &programs[i].task->answerbox;
     267                                if (!ipc_box_0) {
     268                                        ipc_box_0 = &programs[i].task->answerbox;
    269269                                        /*
    270                                          * Hold the first task so that the
    271                                          * ipc_phone_0 remains a valid pointer
     270                                         * Hold the first task so that
     271                                         * ipc_box_0 remains a valid pointer
    272272                                         * even if the first task exits for
    273273                                         * whatever reason.
Note: See TracChangeset for help on using the changeset viewer.