<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>15252</bug_id>
          
          <creation_ts>2023-10-23 11:35:01 +0000</creation_ts>
          <short_desc>Enables CONFIG_DEBUG_PREEMPT</short_desc>
          <delta_ts>2024-03-25 23:05:44 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>kernel</component>
          <version>4.3</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>5.1</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ross Burton">ross.burton</reporter>
          <assigned_to name="Bruce Ashfield">bruce.ashfield</assigned_to>
          <cc>randy.macleod</cc>
    
    <cc>tom.zanussi</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>96763</commentid>
    <comment_count>0</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2023-10-23 11:35:01 +0000</bug_when>
    <thetext>Our kernel enables CONFIG_DEBUG_PREEMPT:

$ grep CONFIG_DEBUG_PREEMPT /yocto/ross/build/tmp/work/qemuarm64-poky-linux/linux-yocto/6.5.7+git/linux-qemuarm64-standard-build/.config
CONFIG_DEBUG_PREEMPT=y

(poky nanbield, qemuarm64)

As per https://lore.kernel.org/lkml/ZTKScoO9kz_LxNMG@ariel/ this is basically a 20% performance hit in some benchmarks.  I think we should disable it in default kernels.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96767</commentid>
    <comment_count>1</comment_count>
    <who name="Bruce Ashfield">bruce.ashfield</who>
    <bug_when>2023-10-23 15:01:05 +0000</bug_when>
    <thetext>We don&apos;t have it on by default, only the selftests do:

lib/oeqa/selftest/cases/runtime_test.py:KERNEL_EXTRA_FEATURES:append = &quot; features/debug/debug-kernel.scc&quot;


So if we don&apos;t want it on for the tests, we need to change it there .. but that would get us less information about crashes and issues, so it isn&apos;t my call to make.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96768</commentid>
    <comment_count>2</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2023-10-23 15:36:59 +0000</bug_when>
    <thetext>I hate to disagree with you, but in a brand new build tree:

$ bitbake virtual/kernel -c showconfig
Config file written to /yocto/ross/buildnew/tmp/work/qemux86_64-poky-linux/linux-yocto/6.5.7+git/linux-qemux86_64-standard-build/.config

$ grep DEBUG.*= /yocto/ross/buildnew/tmp/work/qemux86_64-poky-linux/linux-yocto/6.5.7+git/linux-qemux86_64-standard-build/.config
CONFIG_CGROUP_DEBUG=y
CONFIG_X86_DEBUGCTLMSR=y
CONFIG_PM_DEBUG=y
CONFIG_PM_ADVANCED_DEBUG=y
CONFIG_PM_SLEEP_DEBUG=y
CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
CONFIG_BLK_DEBUG_FS=y
CONFIG_BT_DEBUGFS=y
CONFIG_PNP_DEBUG_MESSAGES=y
CONFIG_SCSI_DEBUG=m
CONFIG_CIFS_DEBUG=y
CONFIG_DEBUG_BUGVERBOSE=y
CONFIG_DEBUG_KERNEL=y
CONFIG_DEBUG_MISC=y
CONFIG_DEBUG_INFO=y
CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y
CONFIG_DEBUG_INFO_COMPRESSED_NONE=y
CONFIG_DEBUG_FS=y
CONFIG_DEBUG_FS_ALLOW_ALL=y
CONFIG_ARCH_HAS_EARLY_DEBUG=y
CONFIG_SLUB_DEBUG=y
CONFIG_ARCH_HAS_DEBUG_WX=y
CONFIG_HAVE_DEBUG_KMEMLEAK=y
CONFIG_ARCH_HAS_DEBUG_VM_PGTABLE=y
CONFIG_ARCH_HAS_DEBUG_VIRTUAL=y
CONFIG_DEBUG_MEMORY_INIT=y
CONFIG_SCHED_DEBUG=y
CONFIG_DEBUG_PREEMPT=y
CONFIG_LOCK_DEBUGGING_SUPPORT=y
CONFIG_X86_DEBUG_FPU=y

After the configure task the top-level .config is the active config, correct?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96769</commentid>
    <comment_count>3</comment_count>
    <who name="Bruce Ashfield">bruce.ashfield</who>
    <bug_when>2023-10-23 17:00:31 +0000</bug_when>
    <thetext>Right, it is also enabled by the poky distro:

meta-poky/conf/distro/poky.conf:KERNEL_EXTRA_FEATURES:append = &quot; features/debug/debug-kernel.scc&quot;

So that is your culprit for the enable.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96770</commentid>
    <comment_count>4</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2023-10-23 17:01:55 +0000</bug_when>
    <thetext>That seems suboptimal.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96771</commentid>
    <comment_count>5</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2023-10-23 17:02:48 +0000</bug_when>
    <thetext>If SPDX needs symbols, can we have separate &quot;debug symbols&quot; and &quot;debug statements&quot;?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97233</commentid>
    <comment_count>6</comment_count>
    <who name="Bruce Ashfield">bruce.ashfield</who>
    <bug_when>2023-11-09 15:36:28 +0000</bug_when>
    <thetext>This is under unit test now.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97238</commentid>
    <comment_count>7</comment_count>
    <who name="Bruce Ashfield">bruce.ashfield</who>
    <bug_when>2023-11-09 17:31:16 +0000</bug_when>
    <thetext>https://git.yoctoproject.org/yocto-kernel-cache/log/?h=yocto-6.5</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>