User: Password:
|
|
Subscribe / Log in / New account

Toward more reliable logging

Toward more reliable logging

Posted Apr 13, 2012 22:00 UTC (Fri) by dlang (subscriber, #313)
Parent article: Toward more reliable logging

generating a sequence number will require a global lock around this value, and can lead to cache ping-pong between processors. I thought this type of thing was being frowned upon.

text buffers can (conceptually anyway) be per-cpu and combined only when read.


(Log in to post comments)

Toward more reliable logging

Posted Apr 13, 2012 22:12 UTC (Fri) by Cyberax (✭ supporter ✭, #52523) [Link]

You'll need sync points to write to log buffers anyway.

And if you spend significant amount of time on locking the log buffer then you probably have MUCH bigger problems.

Toward more reliable logging

Posted Apr 13, 2012 22:21 UTC (Fri) by slashdot (guest, #22014) [Link]

Well, in theory if you have synchronized TSCs you can write the TSC to a local buffer, and then merge the buffers, generating sequence numbers only for the final log.

While the log merging thread does indeed need to synchronize, it doesn't add latency to the log writers, at the cost of multiplying the memory comsumption by the number of CPUs.

But this is an implementation detail, and isn't likely to be worth bothering since logging is supposed to be rare.

Toward more reliable logging

Posted Apr 14, 2012 15:08 UTC (Sat) by Ben_P (guest, #74247) [Link]

Using the TSC seems like it would cause some serious issues if the id's need to increase with time. It is pretty common for some cores to get clocked down or completely turned off in the course of normal operation.

Toward more reliable logging

Posted Apr 17, 2012 5:25 UTC (Tue) by Jannes (guest, #80396) [Link]

A modern TSC keeps counting, at the same constant rate.

Toward more reliable logging

Posted Apr 20, 2012 12:37 UTC (Fri) by jengelh (subscriber, #33263) [Link]

Which not everybody has.

Toward more reliable logging

Posted Apr 15, 2012 0:35 UTC (Sun) by jzbiciak (subscriber, #5246) [Link]

Something tells me that the amount of cacheline ping-ponging this would cause wouldn't be measurable in the least. The context switch for the logger to receive the message ought to be at least an order of magnitude more expensive.


Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds