Messages in this thread | | | Date | Sun, 14 Sep 2008 08:21:26 -0700 | From | "Ulrich Drepper" <> | Subject | Re: [PATCH 12/13] hrtimer: create a "timer_slack" field in the task struct |
| |
On Mon, Sep 8, 2008 at 7:15 AM, Pavel Machek <pavel@suse.cz> wrote: > Ok, so select()/poll() may default to non-zero slack for legacy apps.
That's the goal.
> Yes, it is a great advantage, but it feels like a hack. Maybe it is > better done with LD_PRELOAD or something? > > I'd certianly want the applications to specify slack themselves in > like 10 years.
LD_PRELOAD is not a solution. LD_PRELOAD always has been and always will be a hack. You use it to work around problems or to test something. Nothing else.
LD_PRELOAD and other variables are ignored in security-relevant contexts and environments are cleared in many situations. Sure, you could use /etc/ld.so.preload but that works around only one problem. Furthermore, there is a significant cost associated with preloading. There are additional files to be loaded and it disables prelinking.
The prctl() way plus a default non-zero value is the best way for legacy apps. And you'll hopefully get your wish that apps will take fate into their own hand by specifying the slack themselves. Arjan's proposal also introduces new poll/select-like interface which take the additional slack value (at least that's what we discussed before).
I'm strongly opposed to using LD_PRELOAD. And I think requiring the libc implementation of select/ poll, ... etc to wrap around the new interfaces which take the slack and determine the slack at userlevel (by reading some file) is too expensive. It's one little value per process (group) to be kept by the kernel. That's not much.
| |