lkml.org 
[lkml]   [2021]   [Aug]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRe: [PATCH v34 07/13] mm/damon: Implement a debugfs-based user space interface
    Date
    From: SeongJae Park <sjpark@amazon.de>

    On Thu, 5 Aug 2021 17:43:04 -0700 Andrew Morton <akpm@linux-foundation.org> wrote:

    > On Fri, 16 Jul 2021 08:14:43 +0000 SeongJae Park <sj38.park@gmail.com> wrote:
    >
    > > From: SeongJae Park <sjpark@amazon.de>
    > >
    > > DAMON is designed to be used by kernel space code such as the memory
    > > management subsystems, and therefore it provides only kernel space API.
    > > That said, letting the user space control DAMON could provide some
    > > benefits to them. For example, it will allow user space to analyze
    > > their specific workloads and make their own special optimizations.
    > >
    > > For such cases, this commit implements a simple DAMON application kernel
    > > module, namely 'damon-dbgfs', which merely wraps the DAMON api and
    > > exports those to the user space via the debugfs.
    > >
    > > ...
    > >
    > > +static int __init damon_dbgfs_init(void)
    > > +{
    > > + int rc;
    > > +
    > > + dbgfs_ctxs = kmalloc(sizeof(*dbgfs_ctxs), GFP_KERNEL);
    > > + if (!dbgfs_ctxs) {
    > > + pr_err("%s: dbgfs ctxs alloc failed\n", __func__);
    > > + return -ENOMEM;
    > > + }
    > > + dbgfs_ctxs[0] = dbgfs_new_ctx();
    > > + if (!dbgfs_ctxs[0]) {
    > > + kfree(dbgfs_ctxs);
    > > + pr_err("%s: dbgfs ctx alloc failed\n", __func__);
    > > + return -ENOMEM;
    > > + }
    >
    > checkpatch points out that the "alloc failed" messages are unneeded -
    > kmalloc(GFP_KERNEL) will have already emitted a stack trace. Is this
    > fixup OK?

    Yes, of course. I also see you already kindly applied this in the -mm tree[1],
    appreciate!

    [1] https://www.ozlabs.org/~akpm/mmotm/broken-out/mm-damon-implement-a-debugfs-based-user-space-interface-fix.patch


    Thanks,
    SeongJae Park

    [...]

    \
     
     \ /
      Last update: 2021-08-06 13:47    [W:4.011 / U:0.116 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site