0

I'm running FreeBSD 9.2p13 with UFS and journaled softupdates.

Does anybody know how to tune softupdates journal on UFS?

There are no suitable information in handbook, man pages or sysctl description.

Thanks a lot in advance for any advice or point where I can read more about UFS journaled softupdates tuning.

My issue:

I have some scripts, parsing data, and store it in sophia db.

When a lot of small writes occuring, sometimes filesystem wedges, but disk load, that i could see through gstat, systat, vmstat etc. does not indicate disk or any other overload.

in messages I can see only this:

kernel: softdep: Out of journal space!

when I tried to find the reason I saw normal situation with dirhash and vnodes

sysctl -a | grep dirh
vfs.ufs.dirhash_reclaimage: 5
vfs.ufs.dirhash_lowmemcount: 2795
vfs.ufs.dirhash_docheck: 0
vfs.ufs.dirhash_mem: 141044
vfs.ufs.dirhash_maxmem: 27111424
vfs.ufs.dirhash_minsize: 2560 

sysctl -a | grep vnodes
kern.maxvnodes: 1223926
kern.minvnodes: 305981
vfs.freevnodes: 305981
vfs.wantfreevnodes: 305981
vfs.numvnodes: 389262 

when I tried to run ls to that filesystem terminal freezed, last strings from truss ls shows that:

...
lstat("work",{ mode=drwxr-xr-x
,inode=69662209,size=1024,blksize=32768 }) = 0 (0x0)
getdirentries(0x4,0x80100b000,0x1000,0x8010d9068,0xc94a8,0x0) = 0 (0x0)
lseek(4,0x0,SEEK_SET)                            = 0 (0x0) 

maybe it will be significant info, but there are no description in sysctl:

debug.softdep.jwait_newblk: 104971
debug.softdep.jwait_inode: 16966
debug.softdep.jwait_freeblks: 0
debug.softdep.jwait_filepage: 736
debug.softdep.journal_wait: 122673
debug.softdep.journal_min: 1
debug.softdep.journal_low: 85056 

UPDATE:

Thanks to @Kondibas for answer about tunefs!

Thanks to Vlad for pointing me to the right way :)

When I looked through the source /sys/ufs/ffs/ffs_softdep.c I found all remain answers to my questions.

this points me to situation when message occurs in system log:

            /*
             * Verify some free journal space.  softdep_prealloc() should
             * guarantee that we don't run out so this is indicative of
             * a problem with the flow control.  Try to recover
             * gracefully in any event.
             */
            while (jblocks->jb_free == 0) {
                    if (flags != MNT_WAIT)
                            break;
                    printf("softdep: Out of journal space!\n");
                    softdep_speedup();
                    msleep(jblocks, &lk, PRIBIO, "jblocks", hz);
            }

Here I can see sysctl parameter to monitor situation about journal:

static int stat_journal_low;    /* Times hit journal low threshold */
static int stat_journal_wait;   /* Times blocked in jwait(). */

this parameters I can see in sysctl as:

sysctl debug.softdep.journal_wait
sysctl debug.softdep.journal_low

And here I can see some tunable parameters the sofdep behavior influenced by:

softdep_initialize()
{
        int i;

        LIST_INIT(&mkdirlisthd);
        max_softdeps = desiredvnodes * 4;
        pagedep_hashtbl = hashinit(desiredvnodes / 5, M_PAGEDEP, &pagedep_hash);
        inodedep_hashtbl = hashinit(desiredvnodes, M_INODEDEP, &inodedep_hash);
        newblk_hashtbl = hashinit(desiredvnodes / 5,  M_NEWBLK, &newblk_hash);
        bmsafemap_hashtbl = hashinit(1024, M_BMSAFEMAP, &bmsafemap_hash);

1 Answer 1

0

tunefs have an option -S

-S size
             Specify the softdep journal size in bytes.  The minimum is 4M.

Seems that default value is to small for your FS. You have to fsck your partition, then disable journaling with tunefs -j disable /dev/da0p0x and then reenable journaling with bigger journal tunefs -j enable -S 134217728 /dev/da0p0x

5
  • Thanks! I'll try. But still interesting in reading more about. Seems I need to read sources to know more ))
    – P.S.
    Dec 15, 2014 at 12:30
  • tunefs create journal file according to the size of volume. May be you have volume migrated to the bigger drive?
    – Kondybas
    Dec 15, 2014 at 12:48
  • there were no migration, only some modifications in software ) Do you know - which is the right sysctl variable to monitor journal health?
    – P.S.
    Dec 15, 2014 at 13:32
  • Software journaling is the part of UFS and kernel knows nothing about its health. You can see that something wrong only when work with FS.
    – Kondybas
    Dec 15, 2014 at 13:36
  • I posted an UPDATE to question, now all clear :)
    – P.S.
    Dec 16, 2014 at 11:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .