Re: [Devel] lockdep_assert_held is triggering with the shrinker counter

2018-01-09 Thread Denis Kirjanov
On 1/9/18, Kirill Tkhai  wrote:
> Hi, Denis,
>
> Feel free to CC commit author in the future ;)
>
> On 06.01.2018 21:44, Denis Kirjanov wrote:
>> Hi guys,
>>
>> the following commit triggers the splat in dmesg:
>>
>>
>> The commit is pushed to "branch-rh7-3.10.0-514.26.1.vz7.35.x-ovz" and
>> will appear at https://src.openvz.org/scm/ovz/vzkernel.git
>> after rh7-3.10.0-514.26.1.vz7.35.5
>> -->
>> commit 6fd774dbf6fd05eca8cfa192753bf35dac694368
>> Author: Kirill Tkhai 
>> Date:   Thu Aug 31 18:25:20 2017 +0300
>>
>> your commit added rcu read side enter instead of spinlock but looks
>> like you forgot to update the assert statement in  the
>> list_lru_from_memcg_idx
>
> There is no assert statement in list_lru_from_memcg_idx() anymore.
> I've removed it in:
>
> 5db3da0bf711 "mm: Make list_lru_node::memcg_lrus RCU protected",
> one commit before 6fd774dbf6fd.
>

ah, I see. Missed it.
Thx!

> Do you use modified vzkernel? I assume you use a custom kernel
> with your own modifications, and you don't have ported the commit
> I pointed above.
>
> Kirill
>
___
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel


Re: [Devel] lockdep_assert_held is triggering with the shrinker counter

2018-01-09 Thread Kirill Tkhai
Hi, Denis,

Feel free to CC commit author in the future ;)

On 06.01.2018 21:44, Denis Kirjanov wrote:
> Hi guys,
> 
> the following commit triggers the splat in dmesg:
> 
> 
> The commit is pushed to "branch-rh7-3.10.0-514.26.1.vz7.35.x-ovz" and
> will appear at https://src.openvz.org/scm/ovz/vzkernel.git
> after rh7-3.10.0-514.26.1.vz7.35.5
> -->
> commit 6fd774dbf6fd05eca8cfa192753bf35dac694368
> Author: Kirill Tkhai 
> Date:   Thu Aug 31 18:25:20 2017 +0300
> 
> your commit added rcu read side enter instead of spinlock but looks
> like you forgot to update the assert statement in  the
> list_lru_from_memcg_idx

There is no assert statement in list_lru_from_memcg_idx() anymore.
I've removed it in:

5db3da0bf711 "mm: Make list_lru_node::memcg_lrus RCU protected",
one commit before 6fd774dbf6fd.

Do you use modified vzkernel? I assume you use a custom kernel
with your own modifications, and you don't have ported the commit
I pointed above.

Kirill
___
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel


[Devel] [PATCH] 4.14: remove beancounter cgroup usage

2018-01-09 Thread Stanislav Kinsburskiy
This might be a temporary patch (since we don't have beaconters in 4.14 yet),
but it's needed to proceed with testing.

Signed-off-by: Stanislav Kinsburskiy 
---
 lib/cgroup.c|   30 +-
 lib/cgroup.h|1 -
 lib/env_nsops.c |   38 ++
 3 files changed, 3 insertions(+), 66 deletions(-)

diff --git a/lib/cgroup.c b/lib/cgroup.c
index cd71064..52dc013 100644
--- a/lib/cgroup.c
+++ b/lib/cgroup.c
@@ -56,7 +56,6 @@ static struct cg_ctl cg_ctl_map[] = {
{CG_DEVICES},
{CG_BLKIO},
{CG_FREEZER},
-   {CG_UB, 1},
{CG_VE, 1},
{CG_PERF_EVENT},
{CG_HUGETLB},
@@ -741,39 +740,12 @@ int cg_env_set_memory(const char *ctid, const char *name, 
unsigned long value)
 
 int cg_env_set_ub(const char *ctid, const char *name, unsigned long b, 
unsigned long l)
 {
-   int rc;
-   char _name[STR_SIZE];
-
-   snprintf(_name, sizeof(_name), "beancounter.%s.barrier", name);
-   rc = cg_set_ul(ctid, CG_UB, _name, b);
-   if (rc)
-   return rc;
-
-   snprintf(_name, sizeof(_name), "beancounter.%s.limit", name);
-   return cg_set_ul(ctid, CG_UB, _name, l);
+   return 0;
 }
 
 static int cg_env_set_io(const char *ctid, const char *name, unsigned int 
speed,
unsigned int burst, unsigned int latency)
 {
-   int ret;
-   char buf[STR_SIZE];
-
-   snprintf(buf, sizeof(buf), CG_UB".%s.speed", name);
-   ret = cg_set_ul(ctid, CG_UB, buf, speed);
-   if (ret)
-   return ret;
-
-   snprintf(buf, sizeof(buf), CG_UB".%s.burst", name);
-   ret = cg_set_ul(ctid, CG_UB, buf, burst);
-   if (ret)
-   return ret;
-
-   snprintf(buf, sizeof(buf), CG_UB".%s.latency", name);
-   ret = cg_set_ul(ctid, CG_UB, buf, latency);
-   if (ret)
-   return ret;
-
return 0;
 }
 
diff --git a/lib/cgroup.h b/lib/cgroup.h
index 53429e9..c0b308d 100644
--- a/lib/cgroup.h
+++ b/lib/cgroup.h
@@ -29,7 +29,6 @@
 #define CG_MEMORY  "memory"
 #define CG_NET_CLS "net_cls"
 #define CG_VE  "ve"
-#define CG_UB  "beancounter"
 #define CG_BLKIO   "blkio"
 #define CG_FREEZER "freezer"
 #define CG_PERF_EVENT  "perf_event"
diff --git a/lib/env_nsops.c b/lib/env_nsops.c
index a30eb6a..13e65b0 100644
--- a/lib/env_nsops.c
+++ b/lib/env_nsops.c
@@ -566,24 +566,12 @@ static int init_env_cgroup(struct vzctl_env_handle *h, 
int flags)
"cpuset.cpus",
"cpuset.mems"
};
-   char *bc[] = {
-   "beancounter.memory",
-   "beancounter.blkio"
-   };
 
logger(10, 0, "* init Container cgroup");
if (h->veid && cg_set_veid(EID(h), h->veid) == -1)
return vzctl_err(VZCTL_E_RESOURCE, 0,
"Failed to set VEID=%u", h->veid);
 
-   /* Bind beancounter with blkio/memory cgroups */
-   for (i = 0; i < sizeof(bc)/sizeof(bc[0]); i++) {
-   snprintf(buf, sizeof(buf), "/%s/%s", cg_get_slice_name(), 
EID(h));
-   ret = cg_set_param(EID(h), CG_UB, bc[i], buf);
-   if (ret)
-   return ret;
-   }
-
ret = cg_env_set_memory(h->ctid, "memory.use_hierarchy", 1);
if (ret)
return ret;
@@ -1674,14 +1662,7 @@ static int ns_set_iolimit(struct vzctl_env_handle *h, 
unsigned int speed)
 
 static int ns_get_iolimit(struct vzctl_env_handle *h, unsigned int *speed)
 {
-   int ret;
-   unsigned long n;
-
-   ret = cg_get_ul(EID(h), CG_UB, CG_UB".iolimit.speed", );
-
-   *speed = (unsigned int) n;
-
-   return ret;
+   return 0;
 }
 
 static int ns_set_ioprio(struct vzctl_env_handle *h, int prio)
@@ -1712,13 +1693,7 @@ static int ns_set_iopslimit(struct vzctl_env_handle *h, 
unsigned int speed)
 
 static int ns_get_iopslimit(struct vzctl_env_handle *h, unsigned int *speed)
 {
-   int ret;
-   unsigned long n;
-
-   ret = cg_get_ul(EID(h), CG_UB, CG_UB".iopslimit.speed", );
-   *speed = (unsigned int) n;
-
-   return ret;
+   return 0;
 }
 
 static int ns_get_runtime_param(struct vzctl_env_handle *h, int flags)
@@ -1761,11 +1736,6 @@ int vzctl2_set_limits(struct vzctl_env_handle *h, int 
release)
 {
int ret;
 
-   if (release) {
-   cg_set_ul("", CG_UB, "tasks", getpid());
-   return cg_destroy_cgroup(EID(h));
-   }
-
if (EMPTY_CTID(h->ctid))
vzctl2_generate_ctid(EID(h));
 
@@ -1786,10 +1756,6 @@ int vzctl2_set_limits(struct vzctl_env_handle *h, int 
release)
if (ret)
goto err;
}
-
-   ret = cg_set_ul(EID(h), CG_UB, "tasks", getpid());
-   if (ret)
-   goto err;
}
 
return 0;

___
Devel mailing list