From: Haggai Eran <haggaie@mellanox.com>
To: Parav Pandit <pandit.parav@gmail.com>, Tejun Heo <tj@kernel.org>
Cc: cgroups@vger.kernel.org, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org,
lizefan@huawei.com, Johannes Weiner <hannes@cmpxchg.org>,
Doug Ledford <dledford@redhat.com>,
Liran Liss <liranl@mellanox.com>,
"Hefty, Sean" <sean.hefty@intel.com>,
Jason Gunthorpe <jgunthorpe@obsidianresearch.com>,
Jonathan Corbet <corbet@lwn.net>,
james.l.morris@oracle.com, serge@hallyn.com,
Or Gerlitz <ogerlitz@mellanox.com>,
Matan Barak <matanb@mellanox.com>,
raindel@mellanox.com, akpm@linux-foundation.org,
linux-security-module@vger.kernel.org,
Yishai Hadas <yishaih@mellanox.com>
Subject: Re: [PATCHv9 1/3] rdmacg: Added rdma cgroup controller
Date: Thu, 3 Mar 2016 09:51:51 +0200 [thread overview]
Message-ID: <56D7ED17.30800@mellanox.com> (raw)
In-Reply-To: <CAG53R5VYnTMzG4DchY2DKgveeeXbKcjUWQpOOjCNQuY-f7g9bg@mail.gmail.com>
On 03/03/2016 04:49, Parav Pandit wrote:
> Hi Tejun, Haggai,
>
> On Thu, Mar 3, 2016 at 1:28 AM, Parav Pandit <pandit.parav@gmail.com> wrote:
>>>> + rpool->refcnt--;
>>>> + if (rpool->refcnt == 0 && rpool->num_max_cnt == pool_info->table_len) {
>>>
>>> If the caller charges 2 and then uncharges 1 two times, the refcnt
>>> underflows? Why not just track how many usages are zero?
>>>
>> This is certainly must fix bug. Changed refcnt to usage_sum and changed to do
>> usage_sum -= num during uncharging
>> and
>> usage_sum += num during charing.
>
> This is not sufficient as css_get() and put are done only once per
> call, which leads to similar problem as of refcnt.
Are css_get_many() and css_put_many() relevant here?
> As I think more, I realised that this particular test is missing that
> resulted in this related bug, I realize that we don't have use case to
> have "num" field from the IB stack side.
> For bulk free IB stack will have to keep track of different or same
> rdmacg returned values to call uncharge() with right number of
> resources, all of that complexity just doesn't make sense and not
> required.
> So as first step to further simplify this, I am removing "num" input
> field from charge and uncharge API.
IIRC there are no instances in the RDMA subsystem today where userspace
allocates more than one resource at a time.
Yishai, in your proposed RSS patchset did you have a verb to allocate
multiple work queues at once?
Haggai
WARNING: multiple messages have this Message-ID (diff)
From: Haggai Eran <haggaie@mellanox.com>
To: Parav Pandit <pandit.parav@gmail.com>, Tejun Heo <tj@kernel.org>
Cc: <cgroups@vger.kernel.org>, <linux-doc@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <linux-rdma@vger.kernel.org>,
<lizefan@huawei.com>, Johannes Weiner <hannes@cmpxchg.org>,
Doug Ledford <dledford@redhat.com>,
Liran Liss <liranl@mellanox.com>,
"Hefty, Sean" <sean.hefty@intel.com>,
Jason Gunthorpe <jgunthorpe@obsidianresearch.com>,
Jonathan Corbet <corbet@lwn.net>, <james.l.morris@oracle.com>,
<serge@hallyn.com>, Or Gerlitz <ogerlitz@mellanox.com>,
Matan Barak <matanb@mellanox.com>, <raindel@mellanox.com>,
<akpm@linux-foundation.org>,
<linux-security-module@vger.kernel.org>,
Yishai Hadas <yishaih@mellanox.com>
Subject: Re: [PATCHv9 1/3] rdmacg: Added rdma cgroup controller
Date: Thu, 3 Mar 2016 09:51:51 +0200 [thread overview]
Message-ID: <56D7ED17.30800@mellanox.com> (raw)
In-Reply-To: <CAG53R5VYnTMzG4DchY2DKgveeeXbKcjUWQpOOjCNQuY-f7g9bg@mail.gmail.com>
On 03/03/2016 04:49, Parav Pandit wrote:
> Hi Tejun, Haggai,
>
> On Thu, Mar 3, 2016 at 1:28 AM, Parav Pandit <pandit.parav@gmail.com> wrote:
>>>> + rpool->refcnt--;
>>>> + if (rpool->refcnt == 0 && rpool->num_max_cnt == pool_info->table_len) {
>>>
>>> If the caller charges 2 and then uncharges 1 two times, the refcnt
>>> underflows? Why not just track how many usages are zero?
>>>
>> This is certainly must fix bug. Changed refcnt to usage_sum and changed to do
>> usage_sum -= num during uncharging
>> and
>> usage_sum += num during charing.
>
> This is not sufficient as css_get() and put are done only once per
> call, which leads to similar problem as of refcnt.
Are css_get_many() and css_put_many() relevant here?
> As I think more, I realised that this particular test is missing that
> resulted in this related bug, I realize that we don't have use case to
> have "num" field from the IB stack side.
> For bulk free IB stack will have to keep track of different or same
> rdmacg returned values to call uncharge() with right number of
> resources, all of that complexity just doesn't make sense and not
> required.
> So as first step to further simplify this, I am removing "num" input
> field from charge and uncharge API.
IIRC there are no instances in the RDMA subsystem today where userspace
allocates more than one resource at a time.
Yishai, in your proposed RSS patchset did you have a verb to allocate
multiple work queues at once?
Haggai
next prev parent reply other threads:[~2016-03-03 7:51 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-01 19:05 [PATCHv9 0/3] rdmacg: IB/core: rdma controller support Parav Pandit
2016-03-01 19:05 ` Parav Pandit
2016-03-01 19:05 ` [PATCHv9 1/3] rdmacg: Added rdma cgroup controller Parav Pandit
[not found] ` <1456859137-13646-2-git-send-email-pandit.parav-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-03-02 17:39 ` Tejun Heo
2016-03-02 17:39 ` Tejun Heo
2016-03-02 19:58 ` Parav Pandit
2016-03-03 2:49 ` Parav Pandit
2016-03-03 7:51 ` Haggai Eran [this message]
2016-03-03 7:51 ` Haggai Eran
2016-03-05 11:15 ` Parav Pandit
2016-03-05 12:52 ` Tejun Heo
2016-03-05 17:20 ` Parav Pandit
2016-03-06 8:37 ` Haggai Eran
2016-03-06 8:37 ` Haggai Eran
[not found] ` <CAG53R5V-fhbVqZWroAkvDpgjNWchnO87G47-iXqSGg41sY1A5Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-03-12 6:19 ` Parav Pandit
2016-03-12 6:19 ` Parav Pandit
2016-03-16 20:40 ` Tejun Heo
2016-03-17 20:04 ` Parav Pandit
[not found] ` <CAG53R5UAmTP9-m77-j2tPGZ+z8AicuVvUB_++cRUbQY-EwaBYw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-03-03 3:18 ` Parav Pandit
2016-03-03 3:18 ` Parav Pandit
2016-03-03 8:14 ` Haggai Eran
2016-03-03 8:14 ` Haggai Eran
[not found] ` <56D7F27D.1040702-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2016-03-03 8:31 ` Parav Pandit
2016-03-03 8:31 ` Parav Pandit
2016-03-01 19:05 ` [PATCHv9 2/3] IB/core: added support to use " Parav Pandit
2016-03-02 11:28 ` Haggai Eran
2016-03-02 11:28 ` Haggai Eran
2016-03-01 19:05 ` [PATCHv9 3/3] rdmacg: Added documentation for rdmacg Parav Pandit
2016-03-01 19:05 ` Parav Pandit
[not found] ` <1456859137-13646-1-git-send-email-pandit.parav-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-03-02 17:40 ` [PATCHv9 0/3] rdmacg: IB/core: rdma controller support Tejun Heo
2016-03-02 17:40 ` Tejun Heo
[not found] ` <20160302174052.GH29826-qYNAdHglDFBN0TnZuCh8vA@public.gmane.org>
2016-03-02 19:22 ` Parav Pandit
2016-03-02 19:22 ` Parav Pandit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=56D7ED17.30800@mellanox.com \
--to=haggaie@mellanox.com \
--cc=akpm@linux-foundation.org \
--cc=cgroups@vger.kernel.org \
--cc=corbet@lwn.net \
--cc=dledford@redhat.com \
--cc=hannes@cmpxchg.org \
--cc=james.l.morris@oracle.com \
--cc=jgunthorpe@obsidianresearch.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=liranl@mellanox.com \
--cc=lizefan@huawei.com \
--cc=matanb@mellanox.com \
--cc=ogerlitz@mellanox.com \
--cc=pandit.parav@gmail.com \
--cc=raindel@mellanox.com \
--cc=sean.hefty@intel.com \
--cc=serge@hallyn.com \
--cc=tj@kernel.org \
--cc=yishaih@mellanox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.