Skip to content

RFC An IPC implementation base on Linux IDRs

[email protected] lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest6 patches 5 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6Storing ipcs into IDRsinclude/linux/ipc.h include/linux/msg.h include/linux/sem.h +6 more+329 -3115 replies
2/6Unifying the syscalls codeipc/msg.c ipc/sem.c ipc/shm.c +2 more+217 -1410 replies
3/6Removing the ipc_get() routineipc/shm.c ipc/util.c ipc/util.h+13 -230 replies
4/6Integrating ipc_checkid() into ipc_lock()ipc/msg.c ipc/sem.c ipc/shm.c +2 more+149 -1360 replies
5/6Introducing the ipcid_to_idx macroipc/util.c ipc/util.h+4 -20 replies
6/6Inlining ipc_buildid()ipc/util.c ipc/util.h+5 -60 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC][PATCH 0/6] An IPC implementation base on Linux IDRs

A couple of months ago, I dropped a series of patches that introduced the AKT framework (Automatic Kernel Tunables).

(see thread http://lkml.org/lkml/2007/1/16/16)

When reading the patches, people complained that I was trying to treat a symptom, not the problem itself, and that it'd be better try to rewrite things where necessary (better data structures / implementations).

(see http://lkml.org/lkml/2007/2/7/248)

I'm trying to achieve this for the IPC case, with this new series of patches:
after proposing a radix tree based implementation at the beginning of July, I'm now proposing a new ipc implementation based on the Linux idr API.

In the current ipc implementation, the ipc structures pointers are stored in an array that is resized each time the corresponding tunable is changed (resized means that a new array is allocated with the new size, the old one is copied into that new array and the old array is de-allocated).

With this new implementation, there is no need for the array resizing since the size change becomes "natural".

With this completely dynamic implementation, it becomes possible to set the kernel default maximum values higher in order to prevent early DoS feedback, on configurations with a high amount of memory. Even if the maximum values are huge, no memory space will be wasted, since the allocations are done "on demand". This is not the case with the existing array based implementation:
an array of the maximum number of entries is allocated only if a single ipc object is actually created.

These patches should be applied to 2.6.23-rc2, in the following order:

[PATCH 1/6]: ipc_idr.patch
[PATCH 2/6]: ipc_syscalls.patch
[PATCH 3/6]: ipc_get.patch
[PATCH 4/6]: ipc_lock_and_check.patch
[PATCH 5/6]: ipcid_to_idx.patch
[PATCH 6/6]: ipc_buildid.patch

--

Regards,
Nadia