From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964848AbcFQTxZ (ORCPT ); Fri, 17 Jun 2016 15:53:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38400 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964820AbcFQTxY (ORCPT ); Fri, 17 Jun 2016 15:53:24 -0400 Subject: Re: [RFC 15/18] limits: track RLIMIT_MSGQUEUE actual max To: Topi Miettinen , linux-kernel@vger.kernel.org References: <1465847065-3577-1-git-send-email-toiwoton@gmail.com> <1465847065-3577-16-git-send-email-toiwoton@gmail.com> Cc: Andrew Morton , Michal Hocko , Al Viro , Vladimir Davydov , Marcus Gelderie , "Kirill A. Shutemov" From: Doug Ledford Message-ID: Date: Fri, 17 Jun 2016 15:52:33 -0400 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <1465847065-3577-16-git-send-email-toiwoton@gmail.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="svAgbivnJKsX24ucDpLDuVQOVoB3EahX5" X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Fri, 17 Jun 2016 19:53:23 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --svAgbivnJKsX24ucDpLDuVQOVoB3EahX5 Content-Type: multipart/mixed; boundary="t6MHopF6TXHJUp5dUiBOQx4froK5jCLwv" From: Doug Ledford To: Topi Miettinen , linux-kernel@vger.kernel.org Cc: Andrew Morton , Michal Hocko , Al Viro , Vladimir Davydov , Marcus Gelderie , "Kirill A. Shutemov" Message-ID: Subject: Re: [RFC 15/18] limits: track RLIMIT_MSGQUEUE actual max References: <1465847065-3577-1-git-send-email-toiwoton@gmail.com> <1465847065-3577-16-git-send-email-toiwoton@gmail.com> In-Reply-To: <1465847065-3577-16-git-send-email-toiwoton@gmail.com> --t6MHopF6TXHJUp5dUiBOQx4froK5jCLwv Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 6/13/2016 3:44 PM, Topi Miettinen wrote: > Track maximum size of message queues, presented in /proc/self/limits. >=20 > Signed-off-by: Topi Miettinen > --- > ipc/mqueue.c | 2 ++ > 1 file changed, 2 insertions(+) >=20 > diff --git a/ipc/mqueue.c b/ipc/mqueue.c > index ade739f..edccf55 100644 > --- a/ipc/mqueue.c > +++ b/ipc/mqueue.c > @@ -287,6 +287,8 @@ static struct inode *mqueue_get_inode(struct super_= block *sb, > =20 > /* all is ok */ > info->user =3D get_uid(u); > + /* XXX resource limits apply per task, not per user */ > + bump_rlimit(RLIMIT_MSGQUEUE, u->mq_bytes); > } else if (S_ISDIR(mode)) { > inc_nlink(inode); > /* Some things misbehave if size =3D=3D 0 on a directory */ >=20 This patch looks all sorts of wrong to me. In a current linus tree I can't find a single instance of bump_rlimit. Where is this magical function coming from? Second, u->mq_bytes is the current size of all message queues for a given user. It is not per-task. So your message about limits being per-task is wrong (at least partially, the actual byte count is per-user not per-task, but the limit we check when we create a new queue is per-task and not per-user). So your comment is wrong, the one functional line you added appears to be a non-existent function, and even if those two things are resolved, why in the world would the fact that we created a new message queue mean we should bump our rlimit? That makes no sense, because would *never* have a working rlimit any more, we would simply increase our rlimit by the size of our existing queues every time we made a queue. This is just a totally broken patch. Major NAK. --=20 Doug Ledford GPG Key ID: 0E572FDD --t6MHopF6TXHJUp5dUiBOQx4froK5jCLwv-- --svAgbivnJKsX24ucDpLDuVQOVoB3EahX5 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBCAAGBQJXZFUBAAoJELgmozMOVy/d30kP/i4JyMiupQqk+9ta4xRJeDDy FuZFvb6gllvvOifBLr121sCZ3yrhzaNe4lXDcnvb0SrA+DVANTLrw5fBHBYUMYEH Rb195TeTEp8FSi+YIng2DmqeCeCW8qoAqnIQ9AAtoQFpOoYHhPP+3nvXFXReVuk9 a6+XaC9/RVn/Hh382owZsTdBkqmBi32EvuckyLpni4MjeZ+mRMePj4NkptXX7h+X 3HmbufPwXLvlrIsgK3vXUTW2AgdE5ypR4NHh/9P7CemRAXX38llcXFgNcnkVBXpU DJqGfxmo9R0SgjaIf9dy3hPhZO18+3ZCtWw52DNmWI/u1E8yAq34aGBeXnwGkk2y nAcvGKibdGUjTcrrSQcoDQIkw05MNZJCJGr0CvKs0JKU/vz5F8fGk56ShLrjo4WX J07DElAmRriwPfsfdmFeRYhMZTtW4s3OrHwW/FOd/mqsyeb+jWLln6qoRkFmAHbQ Xp7KnI6akoZkm9xvITIgyF6eEMbxYmYZANdKiL0lCLY1t3LuwQ5qLKIE7PGySvJ/ 2eW6z+pg0uyi739BCgd6PIKHPhPlbWGEY2H2abpKv+qRTe9WMzKZRQry4P0XbsYw XuCrHHszK0vJq1m7yLqBnERRVyNN/xjDSe549szruXiDgExY6JLUfQd80j+gUcZR UktIfNMyJ4gM705+dnci =5TUa -----END PGP SIGNATURE----- --svAgbivnJKsX24ucDpLDuVQOVoB3EahX5--