lkml.org 
[lkml]   [2022]   [Sep]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 3/3] mm,page_owner: Filter out stacks by a threshold counter
On Mon 05-09-22 18:54:59, Ammar Faizi wrote:
> On Mon, 5 Sep 2022 13:31:02 +0200, Michal Hocko wrote:
[...]
> > > static ssize_t write_page_owner_threshold(struct file *file, const char __user *buf,
> > > size_t count, loff_t *pos)
> > > {
> > > char kbuf[21];
> > > int ret;
> > >
> > > count = min_t(size_t, count, sizeof(kbuf));
> > > if (copy_from_user(kbuf, buf, count))
> > > return -EFAULT;
> > >
> > > kbuf[count - 1] = '\0';
> > > ret = kstrtoul(kbuf, 10, &threshold);
> > > return ret ? ret : count;
> > > }
> >
> > Isn't there a proc_dointvec counterpart for debugfs?
>
> Ah, well. If that's much simpler, we should go with that. I am not
> familiar proc_dointvec() interface, so I couldn't say about it.

Just to clarify. proc_dointvec is rather specific to proc/sysctl
interface. I was too lazy to look whether debugfs has something similar
available. Maybe writing to debugfs is not all that common but I would
expect a shared code to write a simple value would be there.

--
Michal Hocko
SUSE Labs

\
 
 \ /
  Last update: 2022-09-05 14:03    [W:0.086 / U:0.520 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site