Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp257040pxb; Wed, 20 Jan 2021 06:26:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJwdCy0uo3pWjBPLa0QjIMNXH+s0X8NSkITrlYSgUY6pwf0NBBE16tdkBH5NSySOZtnuYX0O X-Received: by 2002:a50:ef06:: with SMTP id m6mr6601110eds.216.1611152784034; Wed, 20 Jan 2021 06:26:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611152784; cv=none; d=google.com; s=arc-20160816; b=MEPmTHo+miWqo5yulhvsMw3EPLsZ+yw/+a+gdmhkGbY93oXeht/Bum6/Xq7UE8nGdL Hcu/a+2O1P7Zwiam/2gUPAktQoW4DnaVsAAH9MtQ6KBX60JuSSdrWXjf5NM4ixWhly/z 6euMd5k8zEKv+/Btkn/UIucxjatP0mku3lIzQi/8G2k3bxX1Ko038nTol7GTuFq9Ljbx ivz4AusDFbb3duJ8mgop5n8MFU+yksC/dpH8EN6olXUhTARwyxsb6fEnOcDqqZk5fYh3 xMYfEDpFA3i2iwnPkp65qdQqCAxvsCAOPDK0NsgRNCWJYnjeZe6Mu/p8SSalX2fawmfX YmqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:cc:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=FM37ipdlLykh82wOaMeonjfMEHwci4vUHpTC97P767A=; b=ZqFpf93RSa0W9aFlITLABbbx3cFRa9iou7jBLcch1ItjgL8iGxCx5Msor+lM8rAnZc sowmMUPXYANjk6e5BtKWBQnNpZg6nR133eKyYvRwTIbhhUOXDUYQH0KATp/z9jT3X8Ev tXyCRX50layqdT7fHMv1ERiFCK9GG+oEstPifQ08q+Sqme+7ctktRjvB/Jc/xput47Xp Bw8mwahHGJgJA0ZPiozfCKxzNtrfPmyUQXpLcxWd+JJAsRxtCp0Eq/3TuYIzR6/0W11V f9PH4bGFafH33hBjf7YWYEA17Rh+1OWGOjgUNLYkNrWxOx7TgMg5AHSD1/+MlvTlIo3q dI0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=rOWwKG0Z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h15si697897eje.285.2021.01.20.06.25.59; Wed, 20 Jan 2021 06:26:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=rOWwKG0Z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731043AbhATOYF (ORCPT + 99 others); Wed, 20 Jan 2021 09:24:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42330 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390099AbhATNk2 (ORCPT ); Wed, 20 Jan 2021 08:40:28 -0500 Received: from mail-io1-xd2f.google.com (mail-io1-xd2f.google.com [IPv6:2607:f8b0:4864:20::d2f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 692D6C0613C1 for ; Wed, 20 Jan 2021 05:39:48 -0800 (PST) Received: by mail-io1-xd2f.google.com with SMTP id d13so43627495ioy.4 for ; Wed, 20 Jan 2021 05:39:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:cc; bh=FM37ipdlLykh82wOaMeonjfMEHwci4vUHpTC97P767A=; b=rOWwKG0ZAiK1X30AudSIn50Xfyklr+HXuFqGhgcR7QyAU2YMos1q33iV3Gmobqti7f t6JF6Z6yxq38b3JJUyQCpA/5DFtJ8OLar05WxCI/v229aZO+pwBPksLWH/rwyqhPskPx pZxkmXcSWZFlL/Zb3VPJxMTNNGhhbdfmiP6WCJbg59bpp1FjgSNnem6X/ZpQxBH/0/7m WetdLltV8lKJ6sdhuyaiv0EP0ZQ2zuvmQ8Cros/i9O+efQrCTE15lO5Ttm6xD8PvNsOx HVTq31Yur71rzgSIA7Fihj/oDjkKmCbLOk9MuePvSpMnOsAfrNvE3tt5NXdx3cUVRl6f DfSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:cc; bh=FM37ipdlLykh82wOaMeonjfMEHwci4vUHpTC97P767A=; b=UHjvvoJAX/UUNOREEEf1284u3w5YLwXl9l0Tm0jjbi3UrGGI0aX/DTVw2Mi+lpZofk Hi5qreZfLnfnV3nbX2Jepl9cPxJ+T0tLHlZOoZvjVj0wZM8VFKd8D49Hqb0R2RCMBX4d 2FwXjHTtDtkBziZRk4mShmO+EsaJN1mrDMNnxGwyxzJgRfW0RcdhDkDGnSuJtdHwUtuD GDi/Hu/qGoNKHEwEiuay4sLpYWkze0TcL7xRnFObI0zGvB1lncL5GQpLlAZJA73d8Lh8 90XDbNTW/5h6SjseliUac4D+RWKbaCKkFa3V9a4P+khBui2aypR+pbq/EqF/QqEmcLUh Angw== X-Gm-Message-State: AOAM530n09hqjXeIX1rY4Gaehdq8CdCSh7LTnUiw3UZntI9c65llcQ+g En/y1HadLRTn7L5UlnpoolRz9J2Jd69sFxRq2Rc= X-Received: by 2002:a92:cccd:: with SMTP id u13mt8060864ilq.273.1611149987592; Wed, 20 Jan 2021 05:39:47 -0800 (PST) MIME-Version: 1.0 References: <20210120130233.15932-1-ericcurtin17@gmail.com> In-Reply-To: <20210120130233.15932-1-ericcurtin17@gmail.com> From: Eric Curtin Date: Wed, 20 Jan 2021 13:39:36 +0000 Message-ID: Subject: Re: [PATCH] Increase limit of max_user_watches from 1/25 to 1/16 Cc: Jonathan Corbet , Alexander Viro , "Alexander A. Klimov" , "open list:DOCUMENTATION" , open list , "open list:FILESYSTEMS (VFS and infrastructure)" Content-Type: text/plain; charset="UTF-8" To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 20 Jan 2021 at 13:02, Eric Curtin wrote: > > The current default value for max_user_watches is the 1/16 (6.25%) of > the available low memory, divided for the "watch" cost in bytes. > > Tools like inotify-tools and visual studio code, seem to hit these > limits a little to easy. > > Also amending the documentation, it referred to an old value for this. > > Signed-off-by: Eric Curtin > --- > Documentation/admin-guide/sysctl/fs.rst | 4 ++-- > fs/eventpoll.c | 4 ++-- > 2 files changed, 4 insertions(+), 4 deletions(-) > > diff --git a/Documentation/admin-guide/sysctl/fs.rst b/Documentation/admin-guide/sysctl/fs.rst > index f48277a0a850..f7fe45e69c41 100644 > --- a/Documentation/admin-guide/sysctl/fs.rst > +++ b/Documentation/admin-guide/sysctl/fs.rst > @@ -380,5 +380,5 @@ This configuration option sets the maximum number of "watches" that are > allowed for each user. > Each "watch" costs roughly 90 bytes on a 32bit kernel, and roughly 160 bytes > on a 64bit one. > -The current default value for max_user_watches is the 1/32 of the available > -low memory, divided for the "watch" cost in bytes. > +The current default value for max_user_watches is the 1/16 (6.25%) of the > +available low memory, divided for the "watch" cost in bytes. > diff --git a/fs/eventpoll.c b/fs/eventpoll.c > index a829af074eb5..de9ef8f6d0b2 100644 > --- a/fs/eventpoll.c > +++ b/fs/eventpoll.c > @@ -2352,9 +2352,9 @@ static int __init eventpoll_init(void) > > si_meminfo(&si); > /* > - * Allows top 4% of lomem to be allocated for epoll watches (per user). > + * Allows top 6.25% of lomem to be allocated for epoll watches (per user). > */ > - max_user_watches = (((si.totalram - si.totalhigh) / 25) << PAGE_SHIFT) / > + max_user_watches = (((si.totalram - si.totalhigh) / 16) << PAGE_SHIFT) / > EP_ITEM_COST; > BUG_ON(max_user_watches < 0); > > -- > 2.25.1 > Please ignore this, this is the wrong limit (an epoll one), I sent another patch just to update the documentation to be correct. Weiman Long already kindly solved the issue in 92890123749bafc317bbfacbe0a62ce08d78efb7 Separate patch is titled "[PATCH] Update Documentation/admin-guide/sysctl/fs.rst"