ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:116045] [Ruby master Bug#20157] Regression in GC.measure_total_time
@ 2024-01-06  4:14 rianmcguire (Rian McGuire) via ruby-core
  2024-01-06  4:16 ` [ruby-core:116046] " rianmcguire (Rian McGuire) via ruby-core
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: rianmcguire (Rian McGuire) via ruby-core @ 2024-01-06  4:14 UTC (permalink / raw
  To: ruby-core; +Cc: rianmcguire (Rian McGuire)

Issue #20157 has been reported by rianmcguire (Rian McGuire).

----------------------------------------
Bug #20157: Regression in GC.measure_total_time
https://bugs.ruby-lang.org/issues/20157

* Author: rianmcguire (Rian McGuire)
* Status: Open
* Priority: Normal
* ruby -v: ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [x86_64-linux]
* Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN
----------------------------------------
Setting `GC.measure_total_time = false` is no longer disabling GC time measurement in Ruby 3.3.0.

Reproduction script:
``` ruby
puts RUBY_DESCRIPTION

GC.measure_total_time = false

puts "measure_total_time is now false"
puts "GC.stat(:time) = #{GC.stat(:time)}"
puts "There should be no further clock_gettime syscalls"

# Generate some garbage
Random.new.bytes(100 * 1024 * 1024)
GC.start

puts "GC.stat(:time) = #{GC.stat(:time)}. This should be unchanged from above"
```

Ruby 3.2.2 (expected behaviour):
```
$ strace --trace=clock_gettime --signal=none ruby --disable-gems bug.rb    
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {tv_sec=0, tv_nsec=45735959}) = 0
ruby 3.2.2 (2023-03-30 revision e51014f9c0) [x86_64-linux]
measure_total_time is now false
GC.stat(:time) = 0
There should be no further clock_gettime syscalls
GC.stat(:time) = 0. This should be unchanged from above
+++ exited with 0 +++
```

Ruby 3.3.0:
```
$ strace --trace=clock_gettime --signal=none ruby --disable-gems bug.rb    
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {tv_sec=0, tv_nsec=31784505}) = 0
ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [x86_64-linux]
measure_total_time is now false
GC.stat(:time) = 0
There should be no further clock_gettime syscalls
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {tv_sec=0, tv_nsec=47132055}) = 0
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {tv_sec=0, tv_nsec=47576566}) = 0
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {tv_sec=0, tv_nsec=47586656}) = 0
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {tv_sec=0, tv_nsec=47852906}) = 0
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {tv_sec=0, tv_nsec=180726043}) = 0
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {tv_sec=0, tv_nsec=181242023}) = 0
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {tv_sec=0, tv_nsec=181248873}) = 0
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {tv_sec=0, tv_nsec=191276005}) = 0
GC.stat(:time) = 11. This should be unchanged from above
+++ exited with 0 +++
```

It appears that this was caused by commit https://github.com/ruby/ruby/commit/93ac7405b80cc61930d73da04441fa09af1851e1 -- the test for `MEASURE_GC` inside in `gc_enter_event_measure_p` was lost in the refactoring.



-- 
https://bugs.ruby-lang.org/
 ______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [ruby-core:116046] [Ruby master Bug#20157] Regression in GC.measure_total_time
  2024-01-06  4:14 [ruby-core:116045] [Ruby master Bug#20157] Regression in GC.measure_total_time rianmcguire (Rian McGuire) via ruby-core
@ 2024-01-06  4:16 ` rianmcguire (Rian McGuire) via ruby-core
  2024-01-06  4:27 ` [ruby-core:116047] " rianmcguire (Rian McGuire) via ruby-core
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: rianmcguire (Rian McGuire) via ruby-core @ 2024-01-06  4:16 UTC (permalink / raw
  To: ruby-core; +Cc: rianmcguire (Rian McGuire)

Issue #20157 has been updated by rianmcguire (Rian McGuire).


I've created a PR for this: https://github.com/ruby/ruby/pull/9427

----------------------------------------
Bug #20157: Regression in GC.measure_total_time
https://bugs.ruby-lang.org/issues/20157#change-106042

* Author: rianmcguire (Rian McGuire)
* Status: Open
* Priority: Normal
* ruby -v: ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [x86_64-linux]
* Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN
----------------------------------------
Setting `GC.measure_total_time = false` is no longer disabling GC time measurement in Ruby 3.3.0.

Reproduction script:
``` ruby
puts RUBY_DESCRIPTION

GC.measure_total_time = false

puts "measure_total_time is now false"
puts "GC.stat(:time) = #{GC.stat(:time)}"
puts "There should be no further clock_gettime syscalls"

# Generate some garbage
Random.new.bytes(100 * 1024 * 1024)
GC.start

puts "GC.stat(:time) = #{GC.stat(:time)}. This should be unchanged from above"
```

Ruby 3.2.2 (expected behaviour):
```
$ strace --trace=clock_gettime --signal=none ruby --disable-gems bug.rb    
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {tv_sec=0, tv_nsec=45735959}) = 0
ruby 3.2.2 (2023-03-30 revision e51014f9c0) [x86_64-linux]
measure_total_time is now false
GC.stat(:time) = 0
There should be no further clock_gettime syscalls
GC.stat(:time) = 0. This should be unchanged from above
+++ exited with 0 +++
```

Ruby 3.3.0:
```
$ strace --trace=clock_gettime --signal=none ruby --disable-gems bug.rb    
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {tv_sec=0, tv_nsec=31784505}) = 0
ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [x86_64-linux]
measure_total_time is now false
GC.stat(:time) = 0
There should be no further clock_gettime syscalls
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {tv_sec=0, tv_nsec=47132055}) = 0
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {tv_sec=0, tv_nsec=47576566}) = 0
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {tv_sec=0, tv_nsec=47586656}) = 0
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {tv_sec=0, tv_nsec=47852906}) = 0
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {tv_sec=0, tv_nsec=180726043}) = 0
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {tv_sec=0, tv_nsec=181242023}) = 0
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {tv_sec=0, tv_nsec=181248873}) = 0
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {tv_sec=0, tv_nsec=191276005}) = 0
GC.stat(:time) = 11. This should be unchanged from above
+++ exited with 0 +++
```

It appears that this was caused by commit https://github.com/ruby/ruby/commit/93ac7405b80cc61930d73da04441fa09af1851e1 -- the test for `MEASURE_GC` inside in `gc_enter_event_measure_p` was lost in the refactoring.



-- 
https://bugs.ruby-lang.org/
 ______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [ruby-core:116047] [Ruby master Bug#20157] Regression in GC.measure_total_time
  2024-01-06  4:14 [ruby-core:116045] [Ruby master Bug#20157] Regression in GC.measure_total_time rianmcguire (Rian McGuire) via ruby-core
  2024-01-06  4:16 ` [ruby-core:116046] " rianmcguire (Rian McGuire) via ruby-core
@ 2024-01-06  4:27 ` rianmcguire (Rian McGuire) via ruby-core
  2024-01-06  6:39 ` [ruby-core:116049] " kjtsanaktsidis (KJ Tsanaktsidis) via ruby-core
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: rianmcguire (Rian McGuire) via ruby-core @ 2024-01-06  4:27 UTC (permalink / raw
  To: ruby-core; +Cc: rianmcguire (Rian McGuire)

Issue #20157 has been updated by rianmcguire (Rian McGuire).


I've proposed a fix here: https://github.com/ruby/ruby/pull/9427

----------------------------------------
Bug #20157: Regression in GC.measure_total_time
https://bugs.ruby-lang.org/issues/20157#change-106043

* Author: rianmcguire (Rian McGuire)
* Status: Open
* Priority: Normal
* ruby -v: ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [x86_64-linux]
* Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN
----------------------------------------
Setting `GC.measure_total_time = false` is no longer disabling GC time measurement in Ruby 3.3.0.

Reproduction script:
``` ruby
puts RUBY_DESCRIPTION

GC.measure_total_time = false

puts "measure_total_time is now false"
puts "GC.stat(:time) = #{GC.stat(:time)}"
puts "There should be no further clock_gettime syscalls"

# Generate some garbage
Random.new.bytes(100 * 1024 * 1024)
GC.start

puts "GC.stat(:time) = #{GC.stat(:time)}. This should be unchanged from above"
```

Ruby 3.2.2 (expected behaviour):
```
$ strace --trace=clock_gettime --signal=none ruby --disable-gems bug.rb    
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {tv_sec=0, tv_nsec=45735959}) = 0
ruby 3.2.2 (2023-03-30 revision e51014f9c0) [x86_64-linux]
measure_total_time is now false
GC.stat(:time) = 0
There should be no further clock_gettime syscalls
GC.stat(:time) = 0. This should be unchanged from above
+++ exited with 0 +++
```

Ruby 3.3.0:
```
$ strace --trace=clock_gettime --signal=none ruby --disable-gems bug.rb    
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {tv_sec=0, tv_nsec=31784505}) = 0
ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [x86_64-linux]
measure_total_time is now false
GC.stat(:time) = 0
There should be no further clock_gettime syscalls
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {tv_sec=0, tv_nsec=47132055}) = 0
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {tv_sec=0, tv_nsec=47576566}) = 0
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {tv_sec=0, tv_nsec=47586656}) = 0
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {tv_sec=0, tv_nsec=47852906}) = 0
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {tv_sec=0, tv_nsec=180726043}) = 0
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {tv_sec=0, tv_nsec=181242023}) = 0
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {tv_sec=0, tv_nsec=181248873}) = 0
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {tv_sec=0, tv_nsec=191276005}) = 0
GC.stat(:time) = 11. This should be unchanged from above
+++ exited with 0 +++
```

It appears that this was caused by commit https://github.com/ruby/ruby/commit/93ac7405b80cc61930d73da04441fa09af1851e1 -- the test for `MEASURE_GC` inside in `gc_enter_event_measure_p` was lost in the refactoring.



-- 
https://bugs.ruby-lang.org/
 ______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [ruby-core:116049] [Ruby master Bug#20157] Regression in GC.measure_total_time
  2024-01-06  4:14 [ruby-core:116045] [Ruby master Bug#20157] Regression in GC.measure_total_time rianmcguire (Rian McGuire) via ruby-core
  2024-01-06  4:16 ` [ruby-core:116046] " rianmcguire (Rian McGuire) via ruby-core
  2024-01-06  4:27 ` [ruby-core:116047] " rianmcguire (Rian McGuire) via ruby-core
@ 2024-01-06  6:39 ` kjtsanaktsidis (KJ Tsanaktsidis) via ruby-core
  2024-01-06  6:49 ` [ruby-core:116050] " kjtsanaktsidis (KJ Tsanaktsidis) via ruby-core
  2024-02-01  4:40 ` [ruby-core:116540] " naruse (Yui NARUSE) via ruby-core
  4 siblings, 0 replies; 6+ messages in thread
From: kjtsanaktsidis (KJ Tsanaktsidis) via ruby-core @ 2024-01-06  6:39 UTC (permalink / raw
  To: ruby-core; +Cc: kjtsanaktsidis (KJ Tsanaktsidis)

Issue #20157 has been updated by kjtsanaktsidis (KJ Tsanaktsidis).

Status changed from Open to Closed
Backport changed from 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN to 3.0: DONTNEED, 3.1: DONTNEED, 3.2: DONTNEED, 3.3: REQUIRED

PR above has been merged - thank you again.

----------------------------------------
Bug #20157: Regression in GC.measure_total_time
https://bugs.ruby-lang.org/issues/20157#change-106045

* Author: rianmcguire (Rian McGuire)
* Status: Closed
* Priority: Normal
* ruby -v: ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [x86_64-linux]
* Backport: 3.0: DONTNEED, 3.1: DONTNEED, 3.2: DONTNEED, 3.3: REQUIRED
----------------------------------------
Setting `GC.measure_total_time = false` is no longer disabling GC time measurement in Ruby 3.3.0.

Reproduction script:
``` ruby
puts RUBY_DESCRIPTION

GC.measure_total_time = false

puts "measure_total_time is now false"
puts "GC.stat(:time) = #{GC.stat(:time)}"
puts "There should be no further clock_gettime syscalls"

# Generate some garbage
Random.new.bytes(100 * 1024 * 1024)
GC.start

puts "GC.stat(:time) = #{GC.stat(:time)}. This should be unchanged from above"
```

Ruby 3.2.2 (expected behaviour):
```
$ strace --trace=clock_gettime --signal=none ruby --disable-gems bug.rb    
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {tv_sec=0, tv_nsec=45735959}) = 0
ruby 3.2.2 (2023-03-30 revision e51014f9c0) [x86_64-linux]
measure_total_time is now false
GC.stat(:time) = 0
There should be no further clock_gettime syscalls
GC.stat(:time) = 0. This should be unchanged from above
+++ exited with 0 +++
```

Ruby 3.3.0:
```
$ strace --trace=clock_gettime --signal=none ruby --disable-gems bug.rb    
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {tv_sec=0, tv_nsec=31784505}) = 0
ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [x86_64-linux]
measure_total_time is now false
GC.stat(:time) = 0
There should be no further clock_gettime syscalls
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {tv_sec=0, tv_nsec=47132055}) = 0
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {tv_sec=0, tv_nsec=47576566}) = 0
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {tv_sec=0, tv_nsec=47586656}) = 0
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {tv_sec=0, tv_nsec=47852906}) = 0
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {tv_sec=0, tv_nsec=180726043}) = 0
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {tv_sec=0, tv_nsec=181242023}) = 0
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {tv_sec=0, tv_nsec=181248873}) = 0
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {tv_sec=0, tv_nsec=191276005}) = 0
GC.stat(:time) = 11. This should be unchanged from above
+++ exited with 0 +++
```

It appears that this was caused by commit https://github.com/ruby/ruby/commit/93ac7405b80cc61930d73da04441fa09af1851e1 -- the test for `MEASURE_GC` inside in `gc_enter_event_measure_p` was lost in the refactoring.



-- 
https://bugs.ruby-lang.org/
 ______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [ruby-core:116050] [Ruby master Bug#20157] Regression in GC.measure_total_time
  2024-01-06  4:14 [ruby-core:116045] [Ruby master Bug#20157] Regression in GC.measure_total_time rianmcguire (Rian McGuire) via ruby-core
                   ` (2 preceding siblings ...)
  2024-01-06  6:39 ` [ruby-core:116049] " kjtsanaktsidis (KJ Tsanaktsidis) via ruby-core
@ 2024-01-06  6:49 ` kjtsanaktsidis (KJ Tsanaktsidis) via ruby-core
  2024-02-01  4:40 ` [ruby-core:116540] " naruse (Yui NARUSE) via ruby-core
  4 siblings, 0 replies; 6+ messages in thread
From: kjtsanaktsidis (KJ Tsanaktsidis) via ruby-core @ 2024-01-06  6:49 UTC (permalink / raw
  To: ruby-core; +Cc: kjtsanaktsidis (KJ Tsanaktsidis)

Issue #20157 has been updated by kjtsanaktsidis (KJ Tsanaktsidis).


Backport PR: https://github.com/ruby/ruby/pull/9428

----------------------------------------
Bug #20157: Regression in GC.measure_total_time
https://bugs.ruby-lang.org/issues/20157#change-106046

* Author: rianmcguire (Rian McGuire)
* Status: Closed
* Priority: Normal
* ruby -v: ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [x86_64-linux]
* Backport: 3.0: DONTNEED, 3.1: DONTNEED, 3.2: DONTNEED, 3.3: REQUIRED
----------------------------------------
Setting `GC.measure_total_time = false` is no longer disabling GC time measurement in Ruby 3.3.0.

Reproduction script:
``` ruby
puts RUBY_DESCRIPTION

GC.measure_total_time = false

puts "measure_total_time is now false"
puts "GC.stat(:time) = #{GC.stat(:time)}"
puts "There should be no further clock_gettime syscalls"

# Generate some garbage
Random.new.bytes(100 * 1024 * 1024)
GC.start

puts "GC.stat(:time) = #{GC.stat(:time)}. This should be unchanged from above"
```

Ruby 3.2.2 (expected behaviour):
```
$ strace --trace=clock_gettime --signal=none ruby --disable-gems bug.rb    
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {tv_sec=0, tv_nsec=45735959}) = 0
ruby 3.2.2 (2023-03-30 revision e51014f9c0) [x86_64-linux]
measure_total_time is now false
GC.stat(:time) = 0
There should be no further clock_gettime syscalls
GC.stat(:time) = 0. This should be unchanged from above
+++ exited with 0 +++
```

Ruby 3.3.0:
```
$ strace --trace=clock_gettime --signal=none ruby --disable-gems bug.rb    
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {tv_sec=0, tv_nsec=31784505}) = 0
ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [x86_64-linux]
measure_total_time is now false
GC.stat(:time) = 0
There should be no further clock_gettime syscalls
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {tv_sec=0, tv_nsec=47132055}) = 0
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {tv_sec=0, tv_nsec=47576566}) = 0
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {tv_sec=0, tv_nsec=47586656}) = 0
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {tv_sec=0, tv_nsec=47852906}) = 0
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {tv_sec=0, tv_nsec=180726043}) = 0
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {tv_sec=0, tv_nsec=181242023}) = 0
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {tv_sec=0, tv_nsec=181248873}) = 0
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {tv_sec=0, tv_nsec=191276005}) = 0
GC.stat(:time) = 11. This should be unchanged from above
+++ exited with 0 +++
```

It appears that this was caused by commit https://github.com/ruby/ruby/commit/93ac7405b80cc61930d73da04441fa09af1851e1 -- the test for `MEASURE_GC` inside in `gc_enter_event_measure_p` was lost in the refactoring.



-- 
https://bugs.ruby-lang.org/
 ______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [ruby-core:116540] [Ruby master Bug#20157] Regression in GC.measure_total_time
  2024-01-06  4:14 [ruby-core:116045] [Ruby master Bug#20157] Regression in GC.measure_total_time rianmcguire (Rian McGuire) via ruby-core
                   ` (3 preceding siblings ...)
  2024-01-06  6:49 ` [ruby-core:116050] " kjtsanaktsidis (KJ Tsanaktsidis) via ruby-core
@ 2024-02-01  4:40 ` naruse (Yui NARUSE) via ruby-core
  4 siblings, 0 replies; 6+ messages in thread
From: naruse (Yui NARUSE) via ruby-core @ 2024-02-01  4:40 UTC (permalink / raw
  To: ruby-core; +Cc: naruse (Yui NARUSE)

Issue #20157 has been updated by naruse (Yui NARUSE).

Backport changed from 3.0: DONTNEED, 3.1: DONTNEED, 3.2: DONTNEED, 3.3: REQUIRED to 3.0: DONTNEED, 3.1: DONTNEED, 3.2: DONTNEED, 3.3: DONE

ruby_3_3 920c17dc94239baae05b513046b27967f11a3569.

----------------------------------------
Bug #20157: Regression in GC.measure_total_time
https://bugs.ruby-lang.org/issues/20157#change-106558

* Author: rianmcguire (Rian McGuire)
* Status: Closed
* Priority: Normal
* ruby -v: ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [x86_64-linux]
* Backport: 3.0: DONTNEED, 3.1: DONTNEED, 3.2: DONTNEED, 3.3: DONE
----------------------------------------
Setting `GC.measure_total_time = false` is no longer disabling GC time measurement in Ruby 3.3.0.

Reproduction script:
``` ruby
puts RUBY_DESCRIPTION

GC.measure_total_time = false

puts "measure_total_time is now false"
puts "GC.stat(:time) = #{GC.stat(:time)}"
puts "There should be no further clock_gettime syscalls"

# Generate some garbage
Random.new.bytes(100 * 1024 * 1024)
GC.start

puts "GC.stat(:time) = #{GC.stat(:time)}. This should be unchanged from above"
```

Ruby 3.2.2 (expected behaviour):
```
$ strace --trace=clock_gettime --signal=none ruby --disable-gems bug.rb    
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {tv_sec=0, tv_nsec=45735959}) = 0
ruby 3.2.2 (2023-03-30 revision e51014f9c0) [x86_64-linux]
measure_total_time is now false
GC.stat(:time) = 0
There should be no further clock_gettime syscalls
GC.stat(:time) = 0. This should be unchanged from above
+++ exited with 0 +++
```

Ruby 3.3.0:
```
$ strace --trace=clock_gettime --signal=none ruby --disable-gems bug.rb    
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {tv_sec=0, tv_nsec=31784505}) = 0
ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [x86_64-linux]
measure_total_time is now false
GC.stat(:time) = 0
There should be no further clock_gettime syscalls
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {tv_sec=0, tv_nsec=47132055}) = 0
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {tv_sec=0, tv_nsec=47576566}) = 0
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {tv_sec=0, tv_nsec=47586656}) = 0
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {tv_sec=0, tv_nsec=47852906}) = 0
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {tv_sec=0, tv_nsec=180726043}) = 0
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {tv_sec=0, tv_nsec=181242023}) = 0
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {tv_sec=0, tv_nsec=181248873}) = 0
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, {tv_sec=0, tv_nsec=191276005}) = 0
GC.stat(:time) = 11. This should be unchanged from above
+++ exited with 0 +++
```

It appears that this was caused by commit https://github.com/ruby/ruby/commit/93ac7405b80cc61930d73da04441fa09af1851e1 -- the test for `MEASURE_GC` inside in `gc_enter_event_measure_p` was lost in the refactoring.



-- 
https://bugs.ruby-lang.org/
 ______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-02-01  4:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-06  4:14 [ruby-core:116045] [Ruby master Bug#20157] Regression in GC.measure_total_time rianmcguire (Rian McGuire) via ruby-core
2024-01-06  4:16 ` [ruby-core:116046] " rianmcguire (Rian McGuire) via ruby-core
2024-01-06  4:27 ` [ruby-core:116047] " rianmcguire (Rian McGuire) via ruby-core
2024-01-06  6:39 ` [ruby-core:116049] " kjtsanaktsidis (KJ Tsanaktsidis) via ruby-core
2024-01-06  6:49 ` [ruby-core:116050] " kjtsanaktsidis (KJ Tsanaktsidis) via ruby-core
2024-02-01  4:40 ` [ruby-core:116540] " naruse (Yui NARUSE) via ruby-core

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).