On Sun, 4 May 2025 11:37:54 +0200 Ingo Molnar <mi...@kernel.org> wrote:
Hi Ingo, > * Steven Rostedt <rost...@goodmis.org> wrote: > > > -struct unwind_task_info { > > +struct unwind_cache { > > unsigned long *entries; > > + unsigned int nr_entries; > > +}; > > + > > +struct unwind_task_info { > > + struct unwind_cache cache; > > }; > > > @@ -19,17 +20,29 @@ int unwind_deferred_trace(struct unwind_stacktrace > > *trace) > > if (current->flags & PF_EXITING) > > return -EINVAL; > > > > - if (!info->entries) { > > - info->entries = kmalloc_array(UNWIND_MAX_ENTRIES, > > sizeof(long), > > - GFP_KERNEL); > > - if (!info->entries) > > - return -ENOMEM; > > + if (!cache->entries) { > > + cache->entries = kmalloc_array(UNWIND_MAX_ENTRIES, sizeof(long), > > + GFP_KERNEL); > > + if (!cache->entries) > > + return -ENOMEM; > > + } > > That's just sloppy: why isn't the unwind_cache a pointer to begin with, > with the dynamically allocated object containing ::nr_entries? Basically you want? struct unwind_task_info { struct unwind_cache *cache; }; Then have: struct unwind_cache { int nr_entries; unsigned long entries[]; }; And allocate the unwind_cache to include the size (using the dynamic structure macro helpers)? That makes sense to me. > > Also, the code has whitespace damage. > > > + > > + trace->entries = cache->entries; > > + > > + if (cache->nr_entries) { > > + /* > > + * The user stack has already been previously > > unwound in this > > + * entry context. Skip the unwind and use the > > cache. > > + */ > > + trace->nr = cache->nr_entries; > > + return 0; > > Whitespace damage here too. Maybe in other patches as well. > > Please don't rush this series without first reviewing it carefully ... Hmm, For whitespace damage, I usually rely on git show to show me where whitespace damage is. But if there's no tabs, then it doesn't show. The whitespace damage came from when I pulled in Josh's work and rebased it on the latest kernel. There were conflicts which was solved by having to do some cut and paste from .rej files, and somehow it added spaces instead of tabs. Peter caught this is the beginning, and I thought I got all the locations that had that white space issue. This patch hasn't been touched much during the various versions. I'll do a search for spaces to see if there's more in any of the other patches. Thanks! -- Steve