Eric Lowe writes: > On Wed, Jan 25, 2006 at 03:04:55AM +1100, Brendan Gregg wrote: > | > | The way a freshly written file (as opposed to a freshly mounted file) > | changed the number of faults really threw me. Still haven't put my finger > | on why, but I suspect it's a cache placement policy (maybe MPSS - I need > > This is probably free-behind kicking in in UFS, which by putting the pages > at the head of the cachelists is causing them to be reused before they can > be reactivated. I'm not a UFS expert (thank goodness?) but there is a way to > turn off UFS' freebehind code to see if it is your culprit.
echo freebehind/W0t0 | mdb -kw Back on with : echo freebehind/W0t1 | mdb -kw > > (As an aside, the resulting behavior isn't UFS' fault but the VM's. It > takes the "free" hint a little TOO seriously and essentially discards the > pages, instead of allowing them to age. It's on the list of things to fix > in the new VM system.) There are 2 freebehind thresholds these days; one for the head of cachelist, one for the tail and it's dynamically adjusted based on freemem. -r > > | to go test this on SPARC where I have trapstat. :) > > The only MPSS support for files is for text and data segments. > > - Eric > > | #!/usr/sbin/dtrace -s > | /* todo: hat_memload_array */ > | > | #pragma D option quiet > | #pragma D option defaultargs > | > | inline int SCREEN = 21; > | > | dtrace:::BEGIN > | { > | lines = SCREEN + 1; > | secs = $1 ? $1 : 1; > | counts = $2 ? $2 : -1; > | first = 1; > | @hits = sum(0); > | @miss = sum(0); > | } > | > | profile:::tick-1sec > | { > | secs--; > | } > | > | profile:::tick-1sec > | /first || (secs == 0 && lines > SCREEN)/ > | { > | printf("%10s %10s\n", "HITS", "MISSES"); > | first = 0; > | lines = 0; > | } > | > | fbt::segvn_fault:entry, > | fbt::segvn_faulta:entry > | { > | self->segvn = 1; > | } > | > | fbt::hat_memload:entry > | /self->segvn && args[2]->p_vnode->v_path != NULL/ > | { > | /* > | * hat_memload is interesting (thanks Eric L.) as we use it > | * to track the total number of page creates in segvn, so > | * long as our context is segvn_fault. This value minus io > | * events is used as the hit rate. > | */ > | @path[execname, stringof(args[2]->p_vnode->v_path)] = count(); > | @hits = sum(1); > | } > | > | io:::start > | /self->segvn/ > | { > | /* a segvn miss is an io event within a segvn_fault context */ > | @iobytes[execname, args[2]->fi_pathname, > | args[0]->b_flags & B_READ ? "R" : "W"] = > sum(args[0]->b_bcount); > | @miss = sum(args[0]->b_bcount / `_pagesize); > | @hits = sum(- (args[0]->b_bcount / `_pagesize)); > | } > | > | fbt::segvn_fault:return, > | fbt::segvn_faulta:return > | /self->segvn/ > | { > | self->segvn = 0; > | } > | > | profile:::tick-1sec > | /secs == 0/ > | { > | printa("[EMAIL PROTECTED] ", @hits); > | printa("[EMAIL PROTECTED]", @miss); > | trunc(@hits); > | trunc(@miss); > | @hits = sum(0); > | @miss = sum(0); > | secs = $1 ? $1 : 1; > | lines++; > | counts--; > | } > | > | dtrace:::END > | { > | printf("hat_memload\n-----------\n"); > | printf("%-16s %-50s %8s\n", "CMD", "PATH", "COUNT"); > | printa("%-16s %-50s [EMAIL PROTECTED]", @path); > | > | printf("\nio:::start\n----------\n"); > | printf("%-16s %32s %3s %10s\n", "CMD", "FILE", "DIR", "BYTES"); > | printa("%-16s %32s %3s [EMAIL PROTECTED]", @iobytes); > | } > > > -- > Eric Lowe Solaris Kernel Development Austin, Texas > Sun Microsystems. We make the net work. > x64155/+1(512)401-1155 > _______________________________________________ > perf-discuss mailing list > perf-discuss@opensolaris.org _______________________________________________ perf-discuss mailing list perf-discuss@opensolaris.org