From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Fredrik Klasson" Subject: Re: RFT: updatedb "morning after" problem [was: Re: -mm merge plans for 2.6.23] Date: Thu, 26 Jul 2007 15:05:16 +0200 Message-ID: <6242fec60707260605h27eeb94bm522e01bd749f347c@mail.gmail.com> References: <9a8748490707231608h453eefffx68b9c391897aba70@mail.gmail.com> <2c0942db0707232153j3670ef31kae3907dff1a24cb7@mail.gmail.com> <46A58B49.3050508@yahoo.com.au> <2c0942db0707240915h56e007e3l9110e24a065f2e73@mail.gmail.com> <46A6CC56.6040307@yahoo.com.au> <46A85D95.509@kingswood-consulting.co.uk> <20070726092025.GA9157@elte.hu> <20070726023401.f6a2fbdf.akpm@linux-foundation.org> <20070726094024.GA15583@elte.hu> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============26753880934329843==" Return-path: In-Reply-To: <20070726094024.GA15583@elte.hu> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: ck-bounces@vds.kolivas.org Errors-To: ck-bounces@vds.kolivas.org To: Ingo Molnar Cc: Nick Piggin , Ray Lee , Jesper Juhl , linux-kernel@vger.kernel.org, ck list , linux-mm@kvack.org, Paul Jackson , Andi Kleen , Andrew Morton , Frank Kingswood List-Id: linux-mm.kvack.org --===============26753880934329843== Content-Type: multipart/alternative; boundary="----=_Part_195262_15966373.1185455116504" ------=_Part_195262_15966373.1185455116504 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 7/26/07, Ingo Molnar wrote: > > --- /etc/cron.daily/mlocate.cron.orig > +++ /etc/cron.daily/mlocate.cron > @@ -1,4 +1,7 @@ > #!/bin/sh > nodevs=$(< /proc/filesystems awk '$1 == "nodev" { print $2 }') > renice +19 -p $$ >/dev/null 2>&1 > +PREV=`cat /proc/sys/vm/vfs_cache_pressure 2>/dev/null` > +echo 0 > /proc/sys/vm/vfs_cache_pressure 2>/dev/null > /usr/bin/updatedb -f "$nodevs" > +[ "$PREV" != "" ] && echo $PREV > /proc/sys/vm/vfs_cache_pressure > 2>/dev/null > _______________________________________________ > http://ck.kolivas.org/faqs/replying-to-mailing-list.txt > ck mailing list - mailto: ck@vds.kolivas.org > http://vds.kolivas.org/mailman/listinfo/ck uhm... pardon my ignorance, but, doesn't this hack create a possible race condition? Ie, this job starts, and while updatedb runs some other app/script (let's call it Gort) pokes with vfs_cache_pressure (saving 10000, as it's the current value), then updatedb finishes, and then a while after that Gort stops, "restoring" vfs_cache_pressure to 10000 instead of $PREV? What we _really_ want is an updatedb that > does not disturb the dcache. > just a thought, the problem seems (to me, a mere mortal at best) to be that the functions/program doing the magic messes up caches. Wouldn't the easiest/obvious solution/hack be to use/write an "uncached_" version of those functions/apps? (or one that just reads the cache, but never upsets it by writing to it). Or is that impossible/impractical for some reason? (or worse yet, have I completely missed the point?) -- ... a professor saying: "use this proprietary software to learn computer science" is the same as English professor handing you a copy of Shakespeare and saying: "use this book to learn Shakespeare without opening the book itself. - Bradley Kuhn ------=_Part_195262_15966373.1185455116504 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline

On 7/26/07, Ingo Molnar <mingo@elte.hu> wrote:
--- /etc/cron.daily/mlocate.cron.orig
+++ /etc/cron.daily/mlocate.cron
@@ -1,4 +1,7 @@
#!/bin/sh
nodevs=$(< /proc/filesystems awk '$1 == "nodev" { print $2 }')
renice +19 -p $$ >/dev/null 2>&1
+PREV=`cat /proc/sys/vm/vfs_cache_pressure 2>/dev/null`
+echo 0 > /proc/sys/vm/vfs_cache_pressure 2>/dev/null
/usr/bin/updatedb -f "$nodevs"
+[ "$PREV" != "" ] && echo $PREV > /proc/sys/vm/vfs_cache_pressure 2>/dev/null
_______________________________________________
http://ck.kolivas.org/faqs/replying-to-mailing-list.txt
ck mailing list - mailto: ck@vds.kolivas.org
http://vds.kolivas.org/mailman/listinfo/ck
 
uhm... pardon my ignorance, but, doesn't this hack create a possible race condition?
Ie, this job starts, and while updatedb runs some other app/script (let's call it Gort) pokes with vfs_cache_pressure (saving 10000, as it's the current value), then updatedb finishes, and then a while after that Gort stops, "restoring" vfs_cache_pressure to 10000 instead of $PREV?

What we _really_ want is an updatedb that
does not disturb the dcache.
just a thought, the problem seems (to me, a mere mortal at best) to be that the functions/program doing the magic messes up caches. Wouldn't the easiest/obvious solution/hack be to use/write an "uncached_" version of those functions/apps? (or one that just reads the cache, but never upsets it by writing to it). Or is that impossible/impractical for some reason? (or worse yet, have I completely missed the point?)

--
... a professor saying: "use this proprietary software to learn computer science" is the same as English professor handing you a copy of Shakespeare and saying: "use this book to learn Shakespeare without opening the book itself.
- Bradley Kuhn ------=_Part_195262_15966373.1185455116504-- --===============26753880934329843== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline --===============26753880934329843==--