From nobody Fri May 9 23:51:59 2025 Delivered-To: importer2@patchew.org Received-SPF: pass (zohomail.com: domain of vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; envelope-from=linux-kernel-owner@vger.kernel.org; helo=vger.kernel.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1611152232; cv=none; d=zohomail.com; s=zohoarc; b=oAYBTzKC+e49TWnnWTHz8aeqWjfhaiWYV6A2WJvt/f8Ash2KGZlyOXKIwy0yKaA22HH7GMAsrFv+uyquRiv8SzSGQU6/jDB7ULqcqcEV/So7G7zbIoyfVmg90TlFbsSjOXZaC+IQc74WiPSlOY/1N4/XGoyoNUbEtTda0IQ8vQo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1611152232; h=Content-Transfer-Encoding:Cc:Date:From:List-Id:MIME-Version:Message-ID:Subject:To; bh=aZWXyCbP+U2boEa8uNybDlOvftZDrpKrYpE90tBdO/I=; b=VOxNRcCLgyYJ9swtWsmUX3kes+QT9w9OZARag7c3Az13psott45kX5l0ef3ZHNtgpui1EsC9r0KXHqXY0N2GM11JpVlWRhKzbaBoDB3bEuxAJrADJ5xp9wFkv5sxI8NvfUQkjcA1SM05xhPUDeJFzD8Bl6rQsIE83GjOSwdx/Ns= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mx.zohomail.com with SMTP id 1611152232672890.5726853745781; Wed, 20 Jan 2021 06:17:12 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732666AbhATOP4 (ORCPT ); Wed, 20 Jan 2021 09:15:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34430 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388457AbhATNDd (ORCPT ); Wed, 20 Jan 2021 08:03:33 -0500 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 304D1C0613CF; Wed, 20 Jan 2021 05:02:51 -0800 (PST) Received: by mail-wm1-x32c.google.com with SMTP id o10so3254997wmc.1; Wed, 20 Jan 2021 05:02:51 -0800 (PST) Received: from curtine-Aspire-A515-55.lan ([2001:818:e279:2100:6955:745:9baf:484e]) by smtp.googlemail.com with ESMTPSA id m82sm4035221wmf.29.2021.01.20.05.02.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Jan 2021 05:02:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=aZWXyCbP+U2boEa8uNybDlOvftZDrpKrYpE90tBdO/I=; b=NfTkZ7D2/tplLqXUW2cnYbIE3URW+SkN8m+yTQJ4ZGSL+AYfg3hNlocXoPfV5b2Jhu +ixXi6ZV5/XnLD7pIPYP8OHP9cINcTHBgEeRwUmW/Su7gxq1g1mUYGASMWz7C9zs4t6A y50i3lmSRGUcW04c3vPsr1lCP+85UXzzT9jmE360jaQg3hWMEN+NntHB5lEVWQDFmeWd 05PieFO6nSf8h9OqFZJE4f0oe4wwY/a/6dTYkH9T5sLoIfguuDFs+ld/C8TREnpvs4V1 TKfQU6JwkunadeGlB65yq9UZR02vZ/doEr6MEl4ueGO3fR1IPRWnpQM16XVaDKNZWcIA edAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=aZWXyCbP+U2boEa8uNybDlOvftZDrpKrYpE90tBdO/I=; b=AQFtXNl5rfBx/So9lSG+abxlYZWmulAE2xQ4eVTNp5pg/kU7DJTsI3ep/DT/4vlupu ajsftfDsyvpOZi0LqpwsrjQivtf9Bu8JuRziNERu5FAR03lCfxTU46ssdkiTgQG/ifLV iwg4hmxdMw3fRwfVwWWOW+hEQnghtJbzQ6/4fgaoftIPKUf/b5UMF9HCDit/oc+CtF35 1V4WXY/QiXLPDnHc84ZZrybPEKbR8lVmHHazMT6XgGrpd0jjWv4cWk3hKaOwE21LpJme mtESOWyMlAZlBQFMD6sTa5fLtCLH+VFSAASX1EGZTyNOFAck+zSXxhswxy+mqQy4mcdr jwNA== X-Gm-Message-State: AOAM531xvaokxc9c9PoPkgC0evKlOmh9+7B1EdllJvku6CTWWgNuLJ60 KrnozHQ2lWZJ7b9grwqgHcY= X-Google-Smtp-Source: ABdhPJzmC7mqWGYQbuS7U2cZCI98+spNpj7nNT9OHLll9rJhgKCSZuk0YbuvOhoIj1W8MStOWoiV+Q== X-Received: by 2002:a1c:1d09:: with SMTP id d9mr4229892wmd.125.1611147769957; Wed, 20 Jan 2021 05:02:49 -0800 (PST) From: Eric Curtin Cc: ericcurtin17@gmail.com, Jonathan Corbet , Alexander Viro , "Alexander A. Klimov" , linux-doc@vger.kernel.org (open list:DOCUMENTATION), linux-kernel@vger.kernel.org (open list), linux-fsdevel@vger.kernel.org (open list:FILESYSTEMS (VFS and infrastructure)) Subject: [PATCH] Increase limit of max_user_watches from 1/25 to 1/16 Date: Wed, 20 Jan 2021 13:02:31 +0000 Message-Id: <20210120130233.15932-1-ericcurtin17@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" 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 "w= atches" that are allowed for each user. Each "watch" costs roughly 90 bytes on a 32bit kernel, and roughly 160 byt= es on a 64bit one. -The current default value for max_user_watches is the 1/32 of the availa= ble -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) =20 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 =3D (((si.totalram - si.totalhigh) / 25) << PAGE_SHIFT) / + max_user_watches =3D (((si.totalram - si.totalhigh) / 16) << PAGE_SHIFT) / EP_ITEM_COST; BUG_ON(max_user_watches < 0); =20 --=20 2.25.1