OpenVZ Forum


Home » Mailing lists » Devel » [RFC][-mm PATCH 0/8] Memory controller introduction (v3)
Re: [RFC][-mm PATCH 8/8] Add switch to control what type of pages to limit (v3) [message #19421 is a reply to message #19418] Fri, 20 July 2007 21:41 Go to previous message
Paul Menage is currently offline  Paul Menage
Messages: 642
Registered: September 2006
Senior Member
On 7/20/07, Balbir Singh <balbir@linux.vnet.ibm.com> wrote:
> -static struct mem_container init_mem_container;
> +static ssize_t mem_control_type_read(struct container *cont,
> +                               struct cftype *cft,
> +                               struct file *file, char __user *userbuf,
> +                               size_t nbytes, loff_t *ppos)
> +{
> +       unsigned long val;
> +       char buf[64], *s;
> +       struct mem_container *mem;
> +
> +       mem = mem_container_from_cont(cont);
> +       s = buf;
> +       val = mem->control_type;
> +       s += sprintf(s, "%lu\n", val);
> +       return simple_read_from_buffer((void __user *)userbuf, nbytes,
> +                       ppos, buf, s - buf);
> +}

This could just use the read_uint64() hook and be something like

static u64 mem_container_control_type_read(struct container *cont,
struct cftype *cft)
{
  return mem_container_from_cont(cont)->control_type;
}

Paul
_______________________________________________
Containers mailing list
Containers@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: [ckrm-tech] containers development plans
Next Topic: unexpected scsi timeout
Goto Forum:
  


Current Time: Sun Aug 24 07:38:18 GMT 2025

Total time taken to generate the page: 0.07303 seconds