From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Sun, 19 Jan 2003 11:57:04 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Sun, 19 Jan 2003 11:57:04 -0500 Received: from mail1.bluewin.ch ([195.186.1.74]:13184 "EHLO mail1.bluewin.ch") by vger.kernel.org with ESMTP id ; Sun, 19 Jan 2003 11:57:03 -0500 Message-ID: <3E2ADACA.5050404@linkvest.com> Date: Sun, 19 Jan 2003 18:05:14 +0100 From: Jean-Eric Cuendet User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:0.9.8) Gecko/20020204 X-Accept-Language: en-us MIME-Version: 1.0 To: linux-kernel@vger.kernel.org Subject: Disabling file system caching Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Hi, Is it possible to disable file caching for a given partition or mount? Or at least to limit it at a certain quantity of memory? I think of a BIG compilation (several GB of files) and would tell gcc to not cache the compiled files. Thanks -jec From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Sun, 19 Jan 2003 19:56:20 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Sun, 19 Jan 2003 19:56:20 -0500 Received: from 5-116.ctame701-1.telepar.net.br ([200.193.163.116]:56805 "EHLO 5-116.ctame701-1.telepar.net.br") by vger.kernel.org with ESMTP id ; Sun, 19 Jan 2003 19:56:19 -0500 Date: Sun, 19 Jan 2003 23:05:00 -0200 (BRST) From: Rik van Riel X-X-Sender: riel@imladris.surriel.com To: Jean-Eric Cuendet cc: linux-kernel@vger.kernel.org Subject: Re: Disabling file system caching In-Reply-To: <3E2ADACA.5050404@linkvest.com> Message-ID: References: <3E2ADACA.5050404@linkvest.com> X-spambait: aardvark@kernelnewbies.org X-spammeplease: aardvark@nl.linux.org MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 19 Jan 2003, Jean-Eric Cuendet wrote: > Is it possible to disable file caching for a given partition or mount? No, if you do that mmap(), read(), write() etc. would be impossible. > Or at least to limit it at a certain quantity of memory? Not yet. I'm thinking of implementing something like this for the next version of -rmap (reclaim only from the cache if the cache occupies more than a certain fraction of ram). > I think of a BIG compilation (several GB of files) and would tell gcc to > not cache the compiled files. But what about the .h files ? You will want to cache those. regards, Rik -- Bravely reimplemented by the knights who say "NIH". http://www.surriel.com/ http://guru.conectiva.com/ Current spamtrap: october@surriel.com From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Mon, 20 Jan 2003 02:41:05 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Mon, 20 Jan 2003 02:41:05 -0500 Received: from news.ti.com ([192.94.94.33]:53746 "EHLO dragon.ti.com") by vger.kernel.org with ESMTP id ; Mon, 20 Jan 2003 02:41:04 -0500 From: "Balbir" To: Subject: Re: Disabling file system caching Date: Mon, 20 Jan 2003 13:17:42 +0530 Message-ID: <006f01c2c058$3748ad00$6353579d@india.ti.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook CWS, Build 9.0.2416 (9.0.2911.0) X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Importance: Normal Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Not sure if posting to the newsgroup linux.kernel sends it to the mailing list too. "Balbir Singh" wrote in message news:b0g6q2$lfq$1@tilde.itg.ti.com... > "Rik van Riel" wrote in message > news:20030120011009$2d98@gated-at.bofh.it... > > On Sun, 19 Jan 2003, Jean-Eric Cuendet wrote: > > > > > Is it possible to disable file caching for a given partition or mount? > > > > No, if you do that mmap(), read(), write() etc. would be impossible. > > > > > Or at least to limit it at a certain quantity of memory? > > > > Not yet. I'm thinking of implementing something like this > > for the next version of -rmap (reclaim only from the cache > > if the cache occupies more than a certain fraction of ram). > I think that this feature is very important. In an embedded system using an NFS root filesystem, we found that the file cache would take a lot of memory and all insmods would fail. This is especially true when the system boots up and looks for /lib/modules. I think it should be possible to modify the slab allocator to implement a memory pool. We could add a flag which would prevent the slab from growing beyond its initial size. This approach would work only if the cache is allocated by using the slab allocator. Balbir From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Mon, 20 Jan 2003 07:44:21 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Mon, 20 Jan 2003 07:44:20 -0500 Received: from port-213-148-149-130.reverse.qsc.de ([213.148.149.130]:13704 "EHLO eumucln01.mscsoftware.com") by vger.kernel.org with ESMTP id ; Mon, 20 Jan 2003 07:44:19 -0500 Message-ID: <3E2BF107.AB48694E@mscsoftware.com> Date: Mon, 20 Jan 2003 13:52:24 +0100 From: Martin Knoblauch <"martin.knoblauch "@mscsoftware.com> X-Mailer: Mozilla 4.79 [en] (X11; U; Linux 2.4.20-ac1-mkn i686) X-Accept-Language: en MIME-Version: 1.0 To: riel@conectiva.com.br CC: linux-kernel@vger.kernel.org Subject: Re: Disabling file system caching X-AntiVirus: OK! AntiVir MailGate Version 2.0.1.2; AVE: 6.17.0.2; VDF: 6.17.0.17 at mailmuc has not found any known virus in this email. X-MIMETrack: Itemize by SMTP Server on EUMUCLN01/MSCsoftware(Release 5.0.10 |March 22, 2002) at 01/20/2003 01:48:28 PM, Serialize by Router on EUMUCLN01/MSCsoftware(Release 5.0.10 |March 22, 2002) at 01/20/2003 01:48:36 PM, Serialize complete at 01/20/2003 01:48:36 PM Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org > Re: Disabling file system caching > > From: Rik van Riel (riel@conectiva.com.br) > Date: Sun Jan 19 2003 - 20:05:00 EST > > On Sun, 19 Jan 2003, Jean-Eric Cuendet wrote: > > > Is it possible to disable file caching for a given partition or mount? > > No, if you do that mmap(), read(), write() etc. would be impossible. > > > Or at least to limit it at a certain quantity of memory? > > Not yet. I'm thinking of implementing something like this > for the next version of -rmap (reclaim only from the cache > if the cache occupies more than a certain fraction of ram). > Yes please !!! Yes please !!! Yes please !!! :-) Having a maximum [and maybe minimum] knob for controlling the cache would be an extremely useful feature in some situations. Martin From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Mon, 20 Jan 2003 09:12:23 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Mon, 20 Jan 2003 09:12:23 -0500 Received: from ns1.netroute.cz ([212.71.168.2]:17569 "HELO pop3.netroute.cz") by vger.kernel.org with SMTP id ; Mon, 20 Jan 2003 09:12:22 -0500 Date: Mon, 20 Jan 2003 15:21:19 +0100 From: Jan Hudec To: Balbir Cc: linux-kernel@vger.kernel.org Subject: Re: Disabling file system caching Message-ID: <20030120142119.GB1468@vagabond> Mail-Followup-To: Jan Hudec , Balbir , linux-kernel@vger.kernel.org References: <006f01c2c058$3748ad00$6353579d@india.ti.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <006f01c2c058$3748ad00$6353579d@india.ti.com> User-Agent: Mutt/1.4i Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 20, 2003 at 01:17:42PM +0530, Balbir wrote: > Not sure if posting to the newsgroup linux.kernel sends > it to the mailing list too. > > "Balbir Singh" wrote in message > news:b0g6q2$lfq$1@tilde.itg.ti.com... > > "Rik van Riel" wrote in message > > news:20030120011009$2d98@gated-at.bofh.it... > > > On Sun, 19 Jan 2003, Jean-Eric Cuendet wrote: > > > > > > > Is it possible to disable file caching for a given partition or mount? > > > > > > No, if you do that mmap(), read(), write() etc. would be impossible. > > > > > > > Or at least to limit it at a certain quantity of memory? > > > > > > Not yet. I'm thinking of implementing something like this > > > for the next version of -rmap (reclaim only from the cache > > > if the cache occupies more than a certain fraction of ram). > > > > I think that this feature is very important. In an embedded system > using an NFS root filesystem, we found that the file cache > would take a lot of memory and all insmods would fail. This is > especially true when the system boots up and looks for /lib/modules. > > I think it should be possible to modify the slab allocator to > implement a memory pool. We could add a flag which would prevent > the slab from growing beyond its initial size. > > This approach would work only if the cache is allocated by > using the slab allocator. No, it's not! And the slab alocator should mercilessly rip the cache when it needs some pages. In the NFS root case, I would guess it's a problem of NFS implementation allocating too much kernel memory, since both cache and user-land pages are riped in favor of kernel allocations. ------------------------------------------------------------------------------- Jan 'Bulb' Hudec From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Mon, 20 Jan 2003 14:40:52 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Mon, 20 Jan 2003 14:40:23 -0500 Received: from keetweej.xs4all.nl ([213.84.46.114]:128 "EHLO muur.intranet.vanheusden.com") by vger.kernel.org with ESMTP id ; Mon, 20 Jan 2003 14:38:57 -0500 From: "Folkert van Heusden" To: "'Rik van Riel'" , "'Jean-Eric Cuendet'" Cc: Subject: RE: Disabling file system caching Date: Mon, 20 Jan 2003 20:47:52 +0100 Message-ID: <004001c2c0bc$d1e69750$3640a8c0@boemboem> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook CWS, Build 9.0.2416 (9.0.2910.0) In-Reply-To: X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Importance: Normal Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org > > Is it possible to disable file caching for a given partition or mount? > No, if you do that mmap(), read(), write() etc. would be impossible. Hmmm, maybe there's some way to explicitly flush the read/write-cache? Ok, sync will do nice for the write-cache, but for the read-one? From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Mon, 20 Jan 2003 16:30:27 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Mon, 20 Jan 2003 16:30:27 -0500 Received: from adsl-b3-75-90.telepac.pt ([213.13.75.90]:19597 "HELO puma-vgertech.no-ip.com") by vger.kernel.org with SMTP id ; Mon, 20 Jan 2003 16:30:25 -0500 Message-ID: <3E2C6C92.6060505@vgertech.com> Date: Mon, 20 Jan 2003 21:39:30 +0000 From: Nuno Silva User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021226 Debian/1.2.1-9 X-Accept-Language: en-us, pt MIME-Version: 1.0 To: Folkert van Heusden CC: "'Rik van Riel'" , "'Jean-Eric Cuendet'" , linux-kernel@vger.kernel.org Subject: Re: Disabling file system caching References: <004001c2c0bc$d1e69750$3640a8c0@boemboem> In-Reply-To: <004001c2c0bc$d1e69750$3640a8c0@boemboem> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Folkert van Heusden wrote: >>>Is it possible to disable file caching for a given partition or mount? >> >>No, if you do that mmap(), read(), write() etc. would be impossible. > > > Hmmm, maybe there's some way to explicitly flush the read/write-cache? > Ok, sync will do nice for the write-cache, but for the read-one? AFAIK, you simply can't... I'm trying to do this for several months and no luck. Linux simply caches everything it can in the read-cache. For 99% of all cases this is very good but, for some situations, this is not desireable. For the write cache, you can minimize memory usage playing with /proc/sys/vm (see Documentation/filesystems/proc.txt). Regards, Nuno Silva > > > - > 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/ >