Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965267AbbEMRE5 (ORCPT ); Wed, 13 May 2015 13:04:57 -0400 Received: from mail-ie0-f181.google.com ([209.85.223.181]:35454 "EHLO mail-ie0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932845AbbEMREx (ORCPT ); Wed, 13 May 2015 13:04:53 -0400 MIME-Version: 1.0 X-Originating-IP: [5.101.106.105] In-Reply-To: <20150424153657.GC24029@htj.duckdns.org> References: <1429446154-10660-1-git-send-email-cyphar@cyphar.com> <1429446154-10660-5-git-send-email-cyphar@cyphar.com> <20150422162954.GF10738@htj.duckdns.org> <20150424153657.GC24029@htj.duckdns.org> Date: Thu, 14 May 2015 03:04:52 +1000 Message-ID: Subject: Re: [PATCH v10 4/4] cgroups: implement the PIDs subsystem From: Aleksa Sarai To: Tejun Heo Cc: lizefan@huawei.com, mingo@redhat.com, Peter Zijlstra , richard@nod.at, =?UTF-8?B?RnLDqWTDqXJpYyBXZWlzYmVja2Vy?= , linux-kernel@vger.kernel.org, cgroups@vger.kernel.org Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1156 Lines: 32 Hi Tejun >> >> + /* We use INT_MAX as the maximum value of pid_t. */ >> >> + if (limit < 0 || limit > INT_MAX) >> > >> > This is kinda weird if we're using PIDS_MAX for max as it may end up >> > showing "max" after some larger number is written to the file. >> >> The reason for this is because I believe you said "PIDS_MAX isn't >> meant to be exposed to userspace" (one of the previous patchsets used >> PIDS_MAX as the maximum valid value). > > Yeah, but wouldn't it be weird to allow the userland to input PIDS_MAX > (whatever value that may be) and reads back max? It can be whatever > maximum input value + 1, no? Would you be okay with this? if (limit < 0 || limit >= PIDS_MAX) I'd prefer if we used PIDS_MAX as the maximum input value as well as being the internal representation of the maximum, rather than switching to something like INT_MAX. -- Aleksa Sarai (cyphar) www.cyphar.com -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/