mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 00:32:25 -04:00
Revert "dtrace: make 'ring' and 'fill' policies imply 'noswitch' flag"
This reverts commit e92491d95f.
The general idea looked good to me. In particular, it allowed to save
some memory and avoid memory allocation failures when a large buffer
size was requested along with ring and fill policies.
But I didn't take into account that the second, supposedly unused
buffer, was actually used as the scratch buffer. The scratch buffer is
used as a temporary space for DTrace subroutines like copyin, copyinstr,
and alloca.
I think that the change can be fixed by allocating a separate smaller
buffer for the scratch buffer, but that fix would require more work than
I am able to do now. Hence the revert.
Reported by: Domagoj Stolfa
Diagnosed by: Domagoj Stolfa, markj
MFC after: immediately
This commit is contained in:
parent
26f6c148bc
commit
b9827c007a
1 changed files with 3 additions and 2 deletions
|
|
@ -12058,6 +12058,7 @@ dtrace_buffer_switch(dtrace_buffer_t *buf)
|
|||
hrtime_t now;
|
||||
|
||||
ASSERT(!(buf->dtb_flags & DTRACEBUF_NOSWITCH));
|
||||
ASSERT(!(buf->dtb_flags & DTRACEBUF_RING));
|
||||
|
||||
cookie = dtrace_interrupt_disable();
|
||||
now = dtrace_gethrtime();
|
||||
|
|
@ -14865,10 +14866,10 @@ dtrace_state_buffer(dtrace_state_t *state, dtrace_buffer_t *buf, int which)
|
|||
|
||||
if (which == DTRACEOPT_BUFSIZE) {
|
||||
if (opt[DTRACEOPT_BUFPOLICY] == DTRACEOPT_BUFPOLICY_RING)
|
||||
flags |= DTRACEBUF_RING | DTRACEBUF_NOSWITCH;
|
||||
flags |= DTRACEBUF_RING;
|
||||
|
||||
if (opt[DTRACEOPT_BUFPOLICY] == DTRACEOPT_BUFPOLICY_FILL)
|
||||
flags |= DTRACEBUF_FILL | DTRACEBUF_NOSWITCH;
|
||||
flags |= DTRACEBUF_FILL;
|
||||
|
||||
if (state != dtrace_anon.dta_state ||
|
||||
state->dts_activity != DTRACE_ACTIVITY_ACTIVE)
|
||||
|
|
|
|||
Loading…
Reference in a new issue