All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nikolay Borisov <kernel@kyup.com>
To: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: john@johnmccutchan.com, eparis@redhat.com, ebiederm@xmission.com,
	jack@suse.cz, linux-kernel@vger.kernel.org, avagin@openvz.org,
	netdev@vger.kernel.org, operations@siteground.com
Subject: Re: [PATCH 1/4] inotify: Add infrastructure to account inotify limits per-namespace
Date: Mon, 6 Jun 2016 12:26:20 +0300	[thread overview]
Message-ID: <575541BC.5030809@kyup.com> (raw)
In-Reply-To: <20160606080557.GG2211@uranus.lan>



On 06/06/2016 11:05 AM, Cyrill Gorcunov wrote:
> On Wed, Jun 01, 2016 at 10:52:57AM +0300, Nikolay Borisov wrote:
>> This patch adds the necessary members to user_struct. The idea behind
>> the solution is really simple - user the userns pointers as keys into
>> a hash table which holds the inotify instances/watches counts. This
>> allows to account the limits per userns rather than per real user,
>> which makes certain scenarios such as a single mapped user in a
>> container deplete the inotify resources for all other users, which
>> map to the exact same real user.
>>
>> Signed-off-by: Nikolay Borisov <kernel@kyup.com>
> ...
>> +static inline unsigned long inotify_dec_return_dev(struct user_struct *user,
>> +						   void *key)
>> +{
>> +	struct inotify_state *state;
>> +	unsigned long ret;
>> +
>> +	spin_lock(&user->inotify_lock);
>> +	state = __find_inotify_state(user, key);
>> +	ret = --state->inotify_devs;
>> +	spin_unlock(&user->inotify_lock);
>> +
>> +	return ret;
>> +}
> 
> Hi Nikolay! Could you please explain why this new function is not used anywhere
> in other patches or I miss something obvious?

Hi Cyrill,

It seems this is a left-over from an earlier, internal version of this
patchset. You can disregard it. Also, given the direction that the
discussion with Eric took I think I will be redesigning the solution
entirely. Thanks for taking the time to read the code!


Nikolay

  reply	other threads:[~2016-06-06  9:26 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-01  7:52 [RFC PATCH 0/4] Make inotify instance/watches be accounted per userns Nikolay Borisov
2016-06-01  7:52 ` [PATCH 1/4] inotify: Add infrastructure to account inotify limits per-namespace Nikolay Borisov
2016-06-06  8:05   ` Cyrill Gorcunov
2016-06-06  9:26     ` Nikolay Borisov [this message]
2016-06-01  7:52 ` [PATCH 2/4] inotify: Convert inotify limits to be accounted per-realuser/per-namespace Nikolay Borisov
2016-06-01  7:52 ` [PATCH 3/4] misc: Rename the HASH_SIZE macro Nikolay Borisov
2016-06-01 18:13   ` David Miller
2016-06-01  7:53 ` [PATCH 4/4] inotify: Don't include inotify.h when !CONFIG_INOTIFY_USER Nikolay Borisov
     [not found] ` <1464767580-22732-1-git-send-email-kernel-6AxghH7DbtA@public.gmane.org>
2016-06-01 16:00   ` [RFC PATCH 0/4] Make inotify instance/watches be accounted per userns Eric W. Biederman
2016-06-01 16:00 ` Eric W. Biederman
     [not found]   ` <8737ow7vcp.fsf-JOvCrm2gF+uungPnsOpG7nhyD016LWXt@public.gmane.org>
2016-06-02  6:27     ` Nikolay Borisov
2016-06-02  6:27       ` Nikolay Borisov
     [not found]       ` <574FD1E4.8090109-6AxghH7DbtA@public.gmane.org>
2016-06-02 16:19         ` Eric W. Biederman
2016-06-02 16:19       ` Eric W. Biederman
2016-06-02  7:49     ` Jan Kara
2016-06-02  7:49       ` Jan Kara
     [not found]       ` <20160602074920.GG19636-4I4JzKEfoa/jFM9bn6wA6Q@public.gmane.org>
2016-06-02 16:58         ` Eric W. Biederman
2016-06-02 16:58           ` Eric W. Biederman
     [not found]           ` <87bn3jy1cd.fsf-JOvCrm2gF+uungPnsOpG7nhyD016LWXt@public.gmane.org>
2016-06-03 11:14             ` Nikolay Borisov
2016-06-03 11:14               ` Nikolay Borisov
     [not found]               ` <5751667D.7010207-6AxghH7DbtA@public.gmane.org>
2016-06-03 20:41                 ` Eric W. Biederman
2016-06-03 20:41                   ` Eric W. Biederman
     [not found]                   ` <87inxqovho.fsf-JOvCrm2gF+uungPnsOpG7nhyD016LWXt@public.gmane.org>
2016-06-06  6:41                     ` Nikolay Borisov
2016-06-06  6:41                       ` Nikolay Borisov
2016-06-06 20:00                       ` Eric W. Biederman
     [not found]                       ` <57551B10.6080505-6AxghH7DbtA@public.gmane.org>
2016-06-06 20:00                         ` Eric W. Biederman

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=575541BC.5030809@kyup.com \
    --to=kernel@kyup.com \
    --cc=avagin@openvz.org \
    --cc=ebiederm@xmission.com \
    --cc=eparis@redhat.com \
    --cc=gorcunov@gmail.com \
    --cc=jack@suse.cz \
    --cc=john@johnmccutchan.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=operations@siteground.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.