Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1742779

Re: [PATCH v2 1/2] pid: Replace pid bitmap implementation with IDR API

From Gargi Sharma <gs051095@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH v2 1/2] pid: Replace pid bitmap implementation with IDR API
Date 2017-10-01 12:40 +0200
Message-ID <uvJPc-Wb-15@gated-at.bofh.it> (permalink)
References <uucLD-6o3-3@gated-at.bofh.it> <uucLD-6o3-1@gated-at.bofh.it> <uvIzM-dn-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Sun, Oct 1, 2017 at 2:45 PM, Christoph Hellwig <hch@infradead.org> wrote:
>> -             task_active_pid_ns(current)->last_pid);
>> +             task_active_pid_ns(current)->idr.idr_next-1);
>
> I think we want a well documented helper for this pattern instead
> of poking into the internals.
idr_get_cursor() get can be used instead of idr.idr_next, so that we do not
expose the internals.
>
> Also is last - 1 always the correct answer?  Even with idr_alloc_cyclic
> we could wrap around, couldn't we?
-1 will be incorrect when the pids wrap around. Should we go back to
setting up last_pid as it was done before? Or should we use idr_get_cursor
and determine if pid was rolled over and then perform necessary action?

Thanks!
Gargi

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 0/2] Replace PID bitmap allocation with IDR API Gargi Sharma <gs051095@gmail.com> - 2017-09-27 07:10 +0200
  [PATCH v2 1/2] pid: Replace pid bitmap implementation with IDR API Gargi Sharma <gs051095@gmail.com> - 2017-09-27 07:10 +0200
    Re: [PATCH v2 1/2] pid: Replace pid bitmap implementation with IDR  API Rik van Riel <riel@surriel.com> - 2017-09-27 15:20 +0200
      Re: [PATCH v2 1/2] pid: Replace pid bitmap implementation with IDR  API Oleg Nesterov <oleg@redhat.com> - 2017-09-27 16:10 +0200
        Re: [PATCH v2 1/2] pid: Replace pid bitmap implementation with IDR API Gargi Sharma <gs051095@gmail.com> - 2017-09-27 17:10 +0200
          Re: [PATCH v2 1/2] pid: Replace pid bitmap implementation with IDR  API Oleg Nesterov <oleg@redhat.com> - 2017-09-27 17:20 +0200
      Re: [PATCH v2 1/2] pid: Replace pid bitmap implementation with IDR API Gargi Sharma <gs051095@gmail.com> - 2017-09-27 17:10 +0200
    Re: [PATCH v2 1/2] pid: Replace pid bitmap implementation with IDR  API Oleg Nesterov <oleg@redhat.com> - 2017-09-27 17:10 +0200
    Re: [PATCH v2 1/2] pid: Replace pid bitmap implementation with IDR  API Christoph Hellwig <hch@infradead.org> - 2017-10-01 11:20 +0200
      Re: [PATCH v2 1/2] pid: Replace pid bitmap implementation with IDR API Gargi Sharma <gs051095@gmail.com> - 2017-10-01 12:40 +0200
        Re: [PATCH v2 1/2] pid: Replace pid bitmap implementation with IDR  API Rik van Riel <riel@surriel.com> - 2017-10-02 15:20 +0200
      Re: [PATCH v2 1/2] pid: Replace pid bitmap implementation with IDR  API Rik van Riel <riel@surriel.com> - 2017-10-02 15:10 +0200
  [PATCH v2 2/2] pid: Remove pidhash Gargi Sharma <gs051095@gmail.com> - 2017-09-27 07:10 +0200
    Re: [PATCH v2 2/2] pid: Remove pidhash Oleg Nesterov <oleg@redhat.com> - 2017-09-27 17:50 +0200
      Re: [PATCH v2 2/2] pid: Remove pidhash Oleg Nesterov <oleg@redhat.com> - 2017-09-27 18:30 +0200
        Re: [PATCH v2 2/2] pid: Remove pidhash Gargi Sharma <gs051095@gmail.com> - 2017-09-30 17:50 +0200
      Re: [PATCH v2 2/2] pid: Remove pidhash Rik van Riel <riel@surriel.com> - 2017-10-02 22:50 +0200
        Re: [PATCH v2 2/2] pid: Remove pidhash Gargi Sharma <gs051095@gmail.com> - 2017-10-02 22:50 +0200
      Re: [PATCH v2 2/2] pid: Remove pidhash Oleg Nesterov <oleg@redhat.com> - 2017-10-02 22:50 +0200
      Re: [PATCH v2 2/2] pid: Remove pidhash Rik van Riel <riel@surriel.com> - 2017-10-02 22:50 +0200
  Re: [PATCH v2 0/2] Replace PID bitmap allocation with IDR API ebiederm@xmission.com (Eric W. Biederman) - 2017-09-27 19:20 +0200
    Re: [PATCH v2 0/2] Replace PID bitmap allocation with IDR API Rik van Riel <riel@surriel.com> - 2017-09-28 21:50 +0200
      Re: [PATCH v2 0/2] Replace PID bitmap allocation with IDR API Gargi Sharma <gs051095@gmail.com> - 2017-09-28 22:10 +0200
        Re: [PATCH v2 0/2] Replace PID bitmap allocation with IDR API Rik van Riel <riel@surriel.com> - 2017-09-29 02:40 +0200

csiph-web