Skip to content
Snippets Groups Projects
  1. Feb 09, 2024
    • Linus Torvalds's avatar
      work around gcc bugs with 'asm goto' with outputs · 4356e9f8
      Linus Torvalds authored
      We've had issues with gcc and 'asm goto' before, and we created a
      'asm_volatile_goto()' macro for that in the past: see commits
      3f0116c3 ("compiler/gcc4: Add quirk for 'asm goto' miscompilation
      bug") and a9f18034 ("compiler/gcc4: Make quirk for
      asm_volatile_goto() unconditional").
      
      Then, much later, we ended up removing the workaround in commit
      43c249ea ("compiler-gcc.h: remove ancient workaround for gcc PR
      58670") because we no longer supported building the kernel with the
      affected gcc versions, but we left the macro uses around.
      
      Now, Sean Christopherson reports a new version of a very similar
      problem, which is fixed by re-applying that ancient workaround.  But the
      problem in question is limited to only the 'asm goto with outputs'
      cases, so instead of re-introducing the old workaround as-is, let's
      rename and limit the workaround to just that much less common case.
      
      It looks like there are at least two separate issues that all hit in
      this area:
      
       (a) some versions of gcc don't mark the asm goto as 'volatile' when it
           has outputs:
      
              https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98619
              https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110420
      
           which is easy to work around by just adding the 'volatile' by hand.
      
       (b) Internal compiler errors:
      
              https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110422
      
      
      
           which are worked around by adding the extra empty 'asm' as a
           barrier, as in the original workaround.
      
      but the problem Sean sees may be a third thing since it involves bad
      code generation (not an ICE) even with the manually added 'volatile'.
      
      but the same old workaround works for this case, even if this feels a
      bit like voodoo programming and may only be hiding the issue.
      
      Reported-and-tested-by: default avatarSean Christopherson <seanjc@google.com>
      Link: https://lore.kernel.org/all/20240208220604.140859-1-seanjc@google.com/
      
      
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      Cc: Uros Bizjak <ubizjak@gmail.com>
      Cc: Jakub Jelinek <jakub@redhat.com>
      Cc: Andrew Pinski <quic_apinski@quicinc.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      4356e9f8
  2. Jan 24, 2024
  3. Jan 18, 2024
  4. Dec 20, 2023
  5. Dec 19, 2023
    • Steven Rostedt (Google)'s avatar
      tracing: Allow creating instances with specified system events · d2356997
      Steven Rostedt (Google) authored
      A trace instance may only need to enable specific events. As the eventfs
      directory of an instance currently creates all events which adds overhead,
      allow internal instances to be created with just the events in systems
      that they care about. This currently only deals with systems and not
      individual events, but this should bring down the overhead of creating
      instances for specific use cases quite bit.
      
      The trace_array_get_by_name() now has another parameter "systems". This
      parameter is a const string pointer of a comma/space separated list of
      event systems that should be created by the trace_array. (Note if the
      trace_array already exists, this parameter is ignored).
      
      The list of systems is saved and if a module is loaded, its events will
      not be added unless the system for those events also match the systems
      string.
      
      Link: https://lore.kernel.org/linux-trace-kernel/20231213093701.03fddec0@gandalf.local.home
      
      
      
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
      Cc: Sean Paul <seanpaul@chromium.org>
      Cc: Arun Easi   <aeasi@marvell.com>
      Cc: Daniel Wagner <dwagner@suse.de>
      Tested-by: default avatarDmytro Maluka <dmaluka@chromium.org>
      Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
      d2356997
  6. Dec 13, 2023
  7. Dec 11, 2023
    • Dmitry Rokosov's avatar
      samples/cgroup: introduce memcg memory.events listener · becf6529
      Dmitry Rokosov authored
      This is a simple listener for memory events that handles counter changes
      in runtime.  It can be set up for a specific memory cgroup v2.
      
      The output example:
      =====
      $ /tmp/memcg_event_listener test
      Initialized MEMCG events with counters:
      MEMCG events:
      	low: 0
      	high: 0
      	max: 0
      	oom: 0
      	oom_kill: 0
      	oom_group_kill: 0
      Started monitoring memory events from '/sys/fs/cgroup/test/memory.events'...
      Received event in /sys/fs/cgroup/test/memory.events:
      *** 1 MEMCG oom_kill event, change counter 0 => 1
      Received event in /sys/fs/cgroup/test/memory.events:
      *** 1 MEMCG oom_kill event, change counter 1 => 2
      Received event in /sys/fs/cgroup/test/memory.events:
      *** 1 MEMCG oom_kill event, change counter 2 => 3
      Received event in /sys/fs/cgroup/test/memory.events:
      *** 1 MEMCG oom_kill event, change counter 3 => 4
      Received event in /sys/fs/cgroup/test/memory.events:
      *** 2 MEMCG max events, change counter 0 => 2
      Received event in /sys/fs/cgroup/test/memory.events:
      *** 8 MEMCG max events, change counter 2 => 10
      *** 1 MEMCG oom event, change counter 0 => 1
      Received event in /sys/fs/cgroup/test/memory.events:
      *** 1 MEMCG oom_kill event, change counter 4 => 5
      ^CExiting memcg event listener...
      =====
      
      Link: https://lkml.kernel.org/r/20231123071945.25811-3-ddrokosov@salutedevices.com
      
      
      Signed-off-by: default avatarDmitry Rokosov <ddrokosov@salutedevices.com>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      Cc: Michal Hocko <mhocko@kernel.org>
      Cc: Muchun Song <muchun.song@linux.dev>
      Cc: Roman Gushchin <roman.gushchin@linux.dev>
      Cc: Shakeel Butt <shakeelb@google.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      becf6529
    • Dmitry Rokosov's avatar
      samples: introduce new samples subdir for cgroup · 60433a9d
      Dmitry Rokosov authored
      Patch series "samples: introduce cgroup events listeners", v3.
      
      To begin with, this patch series relocates the cgroup example code to the
      samples/cgroup directory, which is the appropriate location for such code
      snippets.
      
      Furthermore, a new memcg events listener is introduced.  This listener is
      a simple yet effective tool for monitoring memory events and managing
      counter changes during runtime.
      
      Additionally, as per Andrew Morton's suggestion, a helpful reminder
      comment is included in the memcontrol implementation.  This comment serves
      to ensure that the samples code is updated whenever new events are added.
      
      
      This patch (of 3):
      
      Move the cgroup_event_listener for cgroup v1 to the samples directory. 
      This suggestion was proposed by Andrew Morton during the discussion [1].
      
      Link: https://lore.kernel.org/all/20231106140934.3f5d4960141562fe8da53906@linux-foundation.org/ [1]
      Link: https://lkml.kernel.org/r/20231123071945.25811-1-ddrokosov@salutedevices.com
      Link: https://lkml.kernel.org/r/20231123071945.25811-2-ddrokosov@salutedevices.com
      
      
      Signed-off-by: default avatarDmitry Rokosov <ddrokosov@salutedevices.com>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      Cc: Michal Hocko <mhocko@kernel.org>
      Cc: Muchun Song <muchun.song@linux.dev>
      Cc: Roman Gushchin <roman.gushchin@linux.dev>
      Cc: Shakeel Butt <shakeelb@google.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      60433a9d
  8. Nov 30, 2023
  9. Nov 28, 2023
  10. Nov 23, 2023
  11. Oct 26, 2023
  12. Oct 24, 2023
  13. Oct 23, 2023
  14. Oct 09, 2023
  15. Sep 28, 2023
  16. Sep 21, 2023
  17. Sep 08, 2023
  18. Aug 24, 2023
  19. Aug 22, 2023
  20. Aug 21, 2023
Loading