[Crash-utility] mm_struct for exiting tasks
Dave Anderson
anderson at redhat.com
Tue Jul 16 18:50:16 UTC 2013
----- Original Message -----
> Hello,
>
> I'm Justin Vreeland, I'm currently and intern at Cray working with the
> OS/Kernel group. We use crash frequently to track down various problems
> and sometimes we need to get information about tasks that were exiting
> when the dump was taken. Because the mm_struct has been removed from
> the task struct. Crash doesn't let you use vtop or vm to do this so I
> added a way to specify mm_struct (with -M) for tasks whose stats is
> 'Exiting'.
>
> Currently it's a bit hackish it modifies the tasks status and context to
> pass all the checks, and then restores both before returning. If this
> is something you're interested in it I'd be happy to bring it up to
> snuff. Modifications are attached.
>
> --
> -Justin
Hello Justin,
Welcome to the group...
Upon an initial glance, there are a few issues that make this
patch unpalatable.
It advertises the capability of forcing an mm_struct address, but gives
no clue has to how you would determine what the mm_struct address was?
Do you somehow verify that the mm_struct has not been freed by the final
mmput() at the end of exit_mm()?
static void exit_mm(struct task_struct * tsk)
{
...
task_lock(tsk);
tsk->mm = NULL;
up_read(&mm->mmap_sem);
enter_lazy_tlb(mm, current);
task_unlock(tsk);
mm_update_next_owner(mm);
mmput(mm);
}
Aside from that, I do have a problem with changing the prototypes of
functions advertised in defs.h, because they may be used by external
extension modules, and this would break users of vm_area_dump() or
IN_TASK_VMA().
And if the command were to fail while executing, the restoration
code would not run, leaving the task's data in the invalid/modified
state. (There is a command-cleanup facility that could be used, but
this would be the first/only time where valid kernel data is being
modified, which really bothers me...)
That all being said, I don't have a well-thought-out alternative
suggestion -- other than perhaps you can roll your own extension
module, that contains modified/stripped-down versions of vm_area_dump()
and vm_area_page_dump(), where you create your own task_context
structure -- and whatever else is required -- to accomplish the
same result.
Dave
More information about the Crash-utility
mailing list