initial rusage patch.



http://people.freebsd.org/~jeff/rusage3.diff

I'm providing this patch for discussion only. I've just implemented enough that you can see the fallout from this change. I have not yet tested enough to say that this is perfect. I have also not yet fixed the RLIMIT_CPU check in mi_switch().

You can see, however, that with this change there is no access to struct proc in mi_switch() except for INVARIANTS and KTR. Aside, of course, for the rlimit that needs to move anyway.

You can also see, that most access to rusage are done through fewer indirects and to local memory. The storage impact of struct proc doesn't change as pstat can be reclaimed as it could before.

Furthermore, the only time we need locks is in rufetch() where we aggregate the threads counters and rusage structs into one allocated by the caller. Doing this aggregation less frequently means we're touching struct proc less frequently.

In this patch the scheduler lock protects this aggregation. In my threadlock diff this will be protected by the per process spinlock and the thread lock. However, in most places that we aggregate with calcru() we're grabbing a spinlock anyway. So it is not so expensive to grab another.

Thanks,
Jeff
_______________________________________________
freebsd-arch@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-arch
To unsubscribe, send any mail to "freebsd-arch-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • [PATCH 0/4][RFC] lro: Generic Large Receive Offload for TCP traffic
    ... this patch set contains the latest generic LRO code, ... and an eHEA patch demonstrating how the "aggregate SKB" interface has to ... packets but does not modify ETH protocol ...
    (Linux-Kernel)
  • Re: initial rusage patch.
    ... I have updated the patch at the same location to solve various exit related races. ... I have only to fix the cpu limit code. ... The only disadvantage to 2 and 3 is that they require extra space in the proc but reduce runtime, especially on systems with no limits. ... the only time we need locks is in rufetchwhere we aggregate the threads counters and rusage structs into one allocated by the caller. ...
    (freebsd-arch)
  • Re: [PATCH 5/7] more CardServices() removals (drivers/net/wireless)
    ... 3c574_cs was done in the other patch series. ... I didn't receive patch 7/7. ... Could you please aggregate these a bit? ... send the line "unsubscribe linux-kernel" in ...
    (Linux-Kernel)
  • [PATCH 4/8] Fragmentation Avoidance V17: 004_markfree
    ... This patch alters show_free_areasto print out the number of free pages ... for each reclaim type. ... only an aggregate number is ... send the line "unsubscribe linux-kernel" in ...
    (Linux-Kernel)