Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753119AbbGNPyO (ORCPT ); Tue, 14 Jul 2015 11:54:14 -0400 Received: from mga14.intel.com ([192.55.52.115]:15933 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752318AbbGNPyN (ORCPT ); Tue, 14 Jul 2015 11:54:13 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,472,1432623600"; d="scan'208";a="605985714" Message-ID: <55A530A3.2080301@intel.com> Date: Tue, 14 Jul 2015 08:54:11 -0700 From: Dave Hansen User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Mel Gorman , Andrew Morton CC: Nathan Zimmer , Waiman Long , Scott Norton , Daniel J Blueman , Linux-MM , LKML , Al Viro , Linus Torvalds Subject: 4.2-rc2: hitting "file-max limit 8192 reached" References: <1430231830-7702-1-git-send-email-mgorman@suse.de> <1430231830-7702-8-git-send-email-mgorman@suse.de> In-Reply-To: <1430231830-7702-8-git-send-email-mgorman@suse.de> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1489 Lines: 40 My laptop has been behaving strangely with 4.2-rc2. Once I log in to my X session, I start getting all kinds of strange errors from applications and see this in my dmesg: VFS: file-max limit 8192 reached Could this be from CONFIG_DEFERRED_STRUCT_PAGE_INIT=y? files_init() seems top be sizing files_stat.max_files from memory sizes. vfs_caches_init() uses nr_free_pages() to figure out what the "current kernel size" is in early boot. *But* since we have not freed most of our memory, nr_free_pages() is low and makes us calculate the reserve as if the kernel we huge. Adding some printk's confirms this. Broken kernel: vfs_caches_init() mempages: 4026972 vfs_caches_init() reserve: 4021629 vfs_caches_init() mempages (after reserve minus): 5343 files_init() n: 2137 files_init() files_stat.max_files: 8192 Working kernel: vfs_caches_init() mempages: 4026972 vfs_caches_init() reserve: 375 vfs_caches_init() mempages2: 4026597 files_init() n: 1610638 files_init() files_stat.max_files: 1610638 Do we have an alternative to call instead of nr_free_pages() in vfs_caches_init()? I guess we could save off 'nr_initialized' in memmap_init_zone() and then use "nr_initialized - nr_free_pages()", but that seems a bit hackish. -- 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/