Author Topic: JFS - cache MIN and MAX buffer parameters  (Read 8021 times)

Dariusz Piatkowski

  • Hero Member
  • *****
  • Posts: 1343
  • Karma: +26/-0
    • View Profile
JFS - cache MIN and MAX buffer parameters
« on: September 22, 2022, 08:19:00 pm »
Can anyone explain, or has the knowledge of, the use of these parameters by the JFS drivers?

Allow me to explain: I do of course understand at high level what these control, specifically I have the following entry in my CONFIG.SYS:

CALL=G:\OS2\CMD.EXE /Q /C G:\OS2\CACHEJFS.EXE /LW:32,128,8 /MINBUFFER:16000 /MAXBUFFER:32000

...however, as I continue to gather JFS runtime stats I haven't quite figured out what is the impact of the MAXBUFFER parameter in particular.

What I am trying to determine is how the BUFFERs are being allocated and how the MAX setting in particular impacts the availability of either the content or i-node metadata buffers.

Any ideas?

Thanks!

Andreas Schnellbacher

  • Hero Member
  • *****
  • Posts: 827
  • Karma: +14/-0
    • View Profile
Re: JFS - cache MIN and MAX buffer parameters
« Reply #1 on: September 23, 2022, 05:46:18 pm »
Hi Dariusz,

I've once experienced with several cache values. The first try led to an unbootable system. The next tries looked promising, but the lower shared memory consumption was too high for the rest to work flawlessly. (I doubt that the file system drivers can be patched to use the higher shared memory arena.)

From then on I only use default values, but for a server extending the cache might be possible. Due to OS/2's ancient memory management with separating the four arenas, I guess that a significant performance (cache) improvement is not possible. The change to SSD or better NVMe should give far the best improvement.

Sooner or later 32 Bit systems will only run virtualized. (I myself am mostly on bare metal.)

Andi B.

  • Hero Member
  • *****
  • Posts: 852
  • Karma: +11/-2
    • View Profile
Re: JFS - cache MIN and MAX buffer parameters
« Reply #2 on: September 23, 2022, 07:18:52 pm »
There was an excellent presentation about JFS at one of the Warpstock Europe events. I think it was this - http://wse2009.warpevents.eu/uploads/tx_wseevents/APP02-JFS-Cache.pdf

Dariusz Piatkowski

  • Hero Member
  • *****
  • Posts: 1343
  • Karma: +26/-0
    • View Profile
Re: JFS - cache MIN and MAX buffer parameters
« Reply #3 on: September 23, 2022, 07:55:41 pm »
Hi Andreas,

..I've once experienced with several cache values. The first try led to an unbootable system. The next tries looked promising, but the lower shared memory consumption was too high for the rest to work flawlessly. (I doubt that the file system drivers can be patched to use the higher shared memory arena.)...

I do consider myself to be one of the "lucky few" who are able to run with very large JFS cache sizes, in fact I've been enjoying a 1Gig setup for some months now:

Code: [Select]
[G:\]cachejfs

          SyncTime:      32 seconds
            MaxAge:     128 seconds
        BufferIdle:       8 seconds
        Cache Size: 1048567 kbytes
        Min Free buffers:   16000 (   64000 K)
        Max Free buffers:   32000 (  128000 K)
Lazy Write is enabled

For that to work however I needed to re-adjust a number of other system settings. My box is hooked up to a UPS as well, which means a sudden power outage is not going to have an immediate impact, thus a bit of extra "room" to play with as far as some of the settings go.

Dariusz Piatkowski

  • Hero Member
  • *****
  • Posts: 1343
  • Karma: +26/-0
    • View Profile
Re: JFS - cache MIN and MAX buffer parameters
« Reply #4 on: September 23, 2022, 09:08:41 pm »
Hi Andi,
There was an excellent presentation about JFS at one of the Warpstock Europe events. I think it was this - http://wse2009.warpevents.eu/uploads/tx_wseevents/APP02-JFS-Cache.pdf

Thanks...this is by far the most detailed 'actual use case' description we seem to have availabie in our OS/2 community. It is a presentation deck I already have, and given my JFS metrics tracking I have been able to identify the most suitable combination of parameters to reflect my usage of OS/2.

However...why stop now???  8) ...and so the BUFFER controls is what I'm trying to experiment with now, which that presentation really does not talk about with the exception of one line on the 'JFS cache design':

"maxfree>nfreecbufs>minfree"

Well, I understand the MIN part of this, but the MAX doesn't quite correlate to what I'm seeing showing up in nfreecbufs. My nfreecbufs are consistently greater than MAX...so what gives?

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4987
  • Karma: +110/-1
    • View Profile
Re: JFS - cache MIN and MAX buffer parameters
« Reply #5 on: September 23, 2022, 10:07:56 pm »
Could always look at the source. I see this comment in jfs_cachemgr.c,
Code: [Select]
/*
 * try to keep free buffers availble:
 *
 * check if the free list needs replenishing from the cache
 * list. we'll replenish the free list if the number of cbufs
 * on the free list plus the number of cbufs being written to
 * disk for the purpose of replacement (i.e. heading for the
 * free list) is less than or equal to minfree.
 */
if (cachemgr.nfreecbufs + cachemgr.numiolru <= cachemgr.minfree)
{
        /* compute the number of cbufs to recycle from the cache
         * list to keep the number of cbufs on the freelist
         * or heading for the freelist to be maxfree.
         */
        nb = cachemgr.maxfree - cachemgr.nfreecbufs -
                                        cachemgr.numiolru;

And more.
https://github.com/OS2World/DRV-JFS-GPL



Dariusz Piatkowski

  • Hero Member
  • *****
  • Posts: 1343
  • Karma: +26/-0
    • View Profile
Re: JFS - cache MIN and MAX buffer parameters
« Reply #6 on: September 24, 2022, 05:34:21 pm »
Dave!

Could always look at the source. I see this comment in jfs_cachemgr.c,...

CODE!!! My oh my, I'm gonna get me some of that...Thank you!!!