OpenVZ Forum


Home » Mailing lists » Devel » [RFC PATCH] posix timers: allocate timer id per task
Re: [RFC PATCH] posix timers: allocate timer id per task [message #48363 is a reply to message #48361] Mon, 15 October 2012 17:04 Go to previous messageGo to previous message
Peter Zijlstra is currently offline  Peter Zijlstra
Messages: 61
Registered: September 2006
Member
On Mon, 2012-10-15 at 20:17 +0400, Stanislav Kinsbursky wrote:
> This patch is required CRIU project (www.criu.org).
> To migrate processes with posix timers we have to make sure, that we can
> restore posix timer with proper id.
> Currently, this is not true, because timer ids are allocated globally.
> So, this is precursor patch and it's purpose is make posix timer id to be
> allocated per task.
>
> Patch replaces global idr with global hash table for posix timers and
> makes timer ids unique not globally, but per task. Next free timer id is type
> of integer and stored on signal struct (posix_timer_id). If free timer id
> reaches negative value on timer creation, it will be dropped to zero and
> -EAGAIN will be returned to user.
> Hash table is size of page (4KB).
> Key is constructed as follows:
> key = hash_ptr(current->signal) ^ hash_32(posix_timer_id);

but but but.. isn't this what namespaces were invented for to solve? Why
not use the regular namespace infrastructure?
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: [PATCH] proc: check vma->vm_file before dereferencing
Next Topic: [PATCH v6 02/10] ipc: "use key as id" functionality for resource get system call i
Goto Forum:
  


Current Time: Thu Jul 24 16:44:25 GMT 2025

Total time taken to generate the page: 0.19806 seconds