Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2045904imm; Wed, 16 May 2018 07:06:35 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoEqDqKXAmj5yhhJYQwNznOzeVs0q2VKtk4e8zvbUSyEybR5+y9I/kMO7qYTqdy6zlCT+2v X-Received: by 2002:a17:902:76c3:: with SMTP id j3-v6mr1087317plt.15.1526479595320; Wed, 16 May 2018 07:06:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526479595; cv=none; d=google.com; s=arc-20160816; b=HZjzbKW64q7GyUUDJONCZJXNsJ0BRlUkK+S+1Jvc7zipV8X2xwR57yQ71LMlYN9Rgl wVoReOuDFZ4z6Qamm1qE3icN9qnHJfFDsGZ7O2MbYz+oz1OhagaeMpUTzdOvbEEn3D1O GjGFmm6MnaGt1EVhue3kpo0KcKtw49i4TASnf9hpgBlIw9NkCmx+xReZhmzt+NiXqqH5 GzlwLmE7N6ugrQM/GhPWUGk7IAhFekVtmLXLj0GvuOA3U2puex1xImSPaah8J+rPb8Xx mSYNN3qgerzToduFQQY/wXbWW9JtXLSdBSZt6xmZamkqSXfKsXrDDq+AFdzQsnymzjpl chhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature:dkim-signature:arc-authentication-results; bh=ML7QFsG17ddX0DdNyNQ9y8OAHS19fIHDLtcLK9+zvG4=; b=ri6Fo/a4UroWX6bBOxjBZpR6pNZhEijYEEl88ncsKnmt/AEU2/NnNSLc/W1+3Kf9bH kRd9HLRTAe4/PAEZe5YjrCIvMu+L1RjJfkIoe10j5tBMFr4Zea6MRMOUKxYM1p+pYBAU pIoK1l9iBkCti4DcM+bG+dL4oyk/rO0HanuQ1ZJlnI66JpHV6gB9FiFuDeEXpvM0Gvpo 49NCeCypsz4Img2peQKDR3NyrdSPjeIg1Wg0IGG/UCrcPaQ7SIEUnzz2wGHOOXBw3DEy HxliWoO4x761CrAiwzdYC6sZya4R3LMsS7GJA2uZlJP2PnT8VX6QsXj4/Vb7BL2z9hRi vUEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=Db+j/vcq; dkim=fail header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=Smjy+gE7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=fb.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 92-v6si2532109plw.299.2018.05.16.07.06.16; Wed, 16 May 2018 07:06:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=Db+j/vcq; dkim=fail header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=Smjy+gE7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=fb.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752590AbeEPOEb (ORCPT + 99 others); Wed, 16 May 2018 10:04:31 -0400 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:39508 "EHLO mx0b-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751389AbeEPOE2 (ORCPT ); Wed, 16 May 2018 10:04:28 -0400 Received: from pps.filterd (m0109332.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w4GE42UB014445; Wed, 16 May 2018 07:04:24 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=facebook; bh=ML7QFsG17ddX0DdNyNQ9y8OAHS19fIHDLtcLK9+zvG4=; b=Db+j/vcqxOPAQhAddPWx7V/jzQmQz4a6m3/L1Up0g6CkfqH2jEC82nxeeaMy83q/Jmsv qW0WvuzYi+FyLfKzyZsSnJnVZzsIh8E9YZVkenCnRKj8K39BsDRh5vw/AxT90KG3LFPL kHb3tgp9z6kSHUWMpT3hXbiE5ptx8K7qTOk= Received: from mail.thefacebook.com ([199.201.64.23]) by mx0a-00082601.pphosted.com with ESMTP id 2j0fv5rtnh-4 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 16 May 2018 07:04:24 -0700 Received: from PRN-CHUB02.TheFacebook.com (2620:10d:c081:35::11) by PRN-CHUB09.TheFacebook.com (2620:10d:c081:35::18) with Microsoft SMTP Server (TLS) id 14.3.361.1; Wed, 16 May 2018 07:04:23 -0700 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (192.168.54.28) by o365-in.thefacebook.com (192.168.16.12) with Microsoft SMTP Server (TLS) id 14.3.361.1; Wed, 16 May 2018 07:04:22 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.onmicrosoft.com; s=selector1-fb-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ML7QFsG17ddX0DdNyNQ9y8OAHS19fIHDLtcLK9+zvG4=; b=Smjy+gE7jPf0UhNnGaI45CJFL0VG4PTdl30cAlD9p64YBmrIAmM6xbkY5034SkYq6f6iSs4sGVe84NtJLOABNg0mr7pCcF2K6FmG6rcdgGPYqlpA7zorkovC9xSMHU+t4bqGjDYQZtsI1svGclsSQM0a5AaUCsE5SH4sxZh2FZA= Received: from castle.DHCP.thefacebook.com (2620:10d:c092:200::1:67ad) by BL2PR15MB1075.namprd15.prod.outlook.com (2603:10b6:201:17::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.776.11; Wed, 16 May 2018 14:04:18 +0000 Date: Wed, 16 May 2018 15:04:08 +0100 From: Roman Gushchin To: Mike Rapoport CC: Shuah Khan , Tejun Heo , , Subject: Re: [PATCH] selftests: cgroup: memcontrol: add basic test for socket accounting Message-ID: <20180516140332.GA19754@castle.DHCP.thefacebook.com> References: <1526470089-27010-1-git-send-email-rppt@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <1526470089-27010-1-git-send-email-rppt@linux.vnet.ibm.com> User-Agent: Mutt/1.9.2 (2017-12-15) X-Originating-IP: [2620:10d:c092:200::1:67ad] X-ClientProxiedBy: AM6PR0102CA0022.eurprd01.prod.exchangelabs.com (2603:10a6:209:14::35) To BL2PR15MB1075.namprd15.prod.outlook.com (2603:10b6:201:17::9) X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020);SRVR:BL2PR15MB1075; X-Microsoft-Exchange-Diagnostics: 1;BL2PR15MB1075;3:qv8J1Neqyta9595EEB+5ytCUugdGBWkYDumo9h6Vd5iUQN0aq0Ntnd6wi08ZbwDLrOq/xnD00iiPDCl9vT+ojkbhqKOG+JsZqf4ZFADXf9dqFrCC+7W7X0uKu3NUX8xVKNpQdBfKV4AF7mEaalce0uUc8/ZB3WcJBF+HScXwAI72KyZKiTAYaQIhh9z69vyHBjcDSKCgHwrx3F1eKoI7bB5h7l/WsnlOgAbxivs379RQ4s0WfC1Wk1NWXqgC7BmF;25:8j7b8ypMTtyNPQkM1h0yj7xb1V3j9KoSedJCGo8LxeTyHvfPtwkEUhck3C5sCvQHsrPDj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QC7EtOo+kokr52;4:OxJIBNkdb8QAGpTklQi/qYw3cjhQJxNfWCdXC1MXylZ+ai9fW56SgYixr8IkdtGiJ7rGEYGx535hTsk3vppO46pRSTPqoyb9GZ78BPGxM9coyGUBkSwkOvu16JB5fcmRZGq49dpa3StmdoeZMHRVOgBQA4PJPZZxSlLMUwapGagJn9+pkP+DJi0aDFWILXhafoxR2Bjnb+N/cdROxL/F3pqhyAhABRosIoQ99aUTYqjqBxtcKNhH5ncKmX3FlsTOpHsSi7TPzdAVGsdi7X+LGHb+7yOnjdtoqYlbL/Lv+NdJUm+PI2ZHwLCaYO2JZ/c4oiOeao1PbXCOZeBDUlppfw8YgkyVhPuZpNS+jJty48/7qiIO5BfjPjGLHb1CJVNEX/8HSEeVCs7+iCTstjYVXHpx8nSn0YnnUIFAB6DUUy8= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(158342451672863)(265634631926514)(104084551191319)(21532816269658); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(10201501046)(93006095)(93001095)(3231254)(11241501184)(944501410)(52105095)(149027)(150027)(6041310)(20161123558120)(20161123560045)(20161123564045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011);SRVR:BL2PR15MB1075;BCL:0;PCL:0;RULEID:;SRVR:BL2PR15MB1075; X-Forefront-PRVS: 0674DC6DD3 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(39860400002)(39380400002)(366004)(396003)(346002)(376002)(199004)(189003)(6506007)(386003)(229853002)(16526019)(68736007)(186003)(76176011)(86362001)(478600001)(59450400001)(50466002)(7736002)(6666003)(8676002)(81166006)(81156014)(105586002)(6916009)(5660300001)(106356001)(8936002)(7696005)(52116002)(305945005)(55016002)(33656002)(16586007)(9686003)(53936002)(52396003)(316002)(2906002)(46003)(1076002)(4326008)(54906003)(6246003)(23726003)(6116002)(58126008)(446003)(47776003)(486006)(11346002)(476003)(25786009)(97736004)(18370500001)(42262002);DIR:OUT;SFP:1102;SCL:1;SRVR:BL2PR15MB1075;H:castle.DHCP.thefacebook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; Received-SPF: None (protection.outlook.com: fb.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BL2PR15MB1075;23:YR6n0sH5NUvBJOpEXBzj5BFqS/fsgqJSZ4IWoBG52?= =?us-ascii?Q?+ZEOjOZWTNr9fvbHXxlVWNNFtHXW5vBjWPrOkKNNEtV0FzAXaGiYgqbzAMdk?= =?us-ascii?Q?WnxoNapyh8VItnWREXewbtUdhXiaGZSH2hfJm80jquo8LaNIlnYwKqMM8DG8?= =?us-ascii?Q?SUXTvdzoL89bC1rvopTIEGNppKDOpvSFPMPjoXXW+SH1gDT0GwEQaJTCvh94?= =?us-ascii?Q?pPsHU4Nq9TdxkvefVd+2U4iPPqFlMM0z9DF9sYU2ZGolf/qqLPBnaadl+xDY?= =?us-ascii?Q?oX0jQPpss9AkLMX7ym680sj6AJgWh+vrkqIj67Qs1yUQwgl+gSpDUqE+n3Tv?= =?us-ascii?Q?FrqTOc+gKmCAlly83UMqlNOQn5Bw0wnsVJgWCjZN8go4CPGUbvkVHU+w4/bQ?= =?us-ascii?Q?UBfsY88ROf9m73F+PbDIRJwCnlnX0ZG+qOIPXuN274pJYxT19QAAeRm+xqzQ?= =?us-ascii?Q?QJfMRRbHoIZrMfhOxUHpR2n7WfDsInv2jM2C4k0Y9ZKFpmXMTKnsNAExQ0Fz?= =?us-ascii?Q?pyNrasHLKCjb6GEjKFg71/Z3Z9mMrSSzHrXP3ImXwbwtv6iIFDL69ZVHgMoY?= =?us-ascii?Q?1ExloxOxvvMVSjS07z9LoB4HeOzSMIZoIzkk6FlytPeq/gqn8llcNJv0QfnD?= =?us-ascii?Q?f1FixSVwaomGRgtI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uneuR+Ca/1VYljmgFPQduAaK3IEXwSKNf5WRp7FajONE9/ynlFoJUJtPGIBrbCRfUY0PHmOwT4c9WSc5qLcazSvJe+7/3YMviYgby9+QU5LT8HerV0bVCb7t3qMk= X-MS-Office365-Filtering-Correlation-Id: f8097e56-290c-430f-ac41-08d5bb35eb0d X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 May 2018 14:04:18.6619 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f8097e56-290c-430f-ac41-08d5bb35eb0d X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL2PR15MB1075 X-OriginatorOrg: fb.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-05-16_07:,, signatures=0 X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Mike! On Wed, May 16, 2018 at 02:28:09PM +0300, Mike Rapoport wrote: > The test verifies that with active TCP traffic memory.current and > memory.stat.sock have similar values. > > Signed-off-by: Mike Rapoport > --- > tools/testing/selftests/cgroup/test_memcontrol.c | 184 +++++++++++++++++++++++ > 1 file changed, 184 insertions(+) > > diff --git a/tools/testing/selftests/cgroup/test_memcontrol.c b/tools/testing/selftests/cgroup/test_memcontrol.c > index beae06c9c899..0efdb1009175 100644 > --- a/tools/testing/selftests/cgroup/test_memcontrol.c > +++ b/tools/testing/selftests/cgroup/test_memcontrol.c > @@ -9,6 +9,12 @@ > #include > #include > #include > +#include > +#include > +#include > +#include > +#include > +#include > > #include "../kselftest.h" > #include "cgroup_util.h" > @@ -772,6 +778,183 @@ static int test_memcg_oom_events(const char *root) > return ret; > } > > +struct tcp_server_args { > + unsigned short port; > + int ctl[2]; > +}; > + > +static int tcp_server(const char *cgroup, void *arg) > +{ > + struct tcp_server_args *srv_args = arg; > + struct sockaddr_in6 saddr = { 0 }; > + socklen_t slen = sizeof(saddr); > + int sk, client_sk, ctl_fd, yes = 1, ret = -1; > + > + close(srv_args->ctl[0]); > + ctl_fd = srv_args->ctl[1]; > + > + saddr.sin6_family = AF_INET6; > + saddr.sin6_addr = in6addr_any; > + saddr.sin6_port = htons(srv_args->port); > + > + sk = socket(AF_INET6, SOCK_STREAM, 0); > + if (sk < 0) > + return ret; > + > + if (setsockopt(sk, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(yes)) < 0) > + goto cleanup; > + > + if (bind(sk, (struct sockaddr *)&saddr, slen)) { > + write(ctl_fd, &errno, sizeof(errno)); > + goto cleanup; > + } > + > + if (listen(sk, 1)) > + goto cleanup; > + > + ret = 0; > + if (write(ctl_fd, &ret, sizeof(ret)) != sizeof(ret)) { > + ret = -1; > + goto cleanup; > + } > + > + client_sk = accept(sk, NULL, NULL); > + if (client_sk < 0) > + goto cleanup; > + > + ret = -1; > + for (;;) { > + uint8_t buf[0x100000]; > + > + if (write(client_sk, buf, sizeof(buf)) <= 0) { > + if (errno == ECONNRESET) > + ret = 0; > + break; > + } > + } > + > + close(client_sk); > + > +cleanup: > + close(sk); > + return ret; > +} > + > +static int tcp_client(const char *cgroup, unsigned short port) > +{ > + const char server[] = "localhost"; > + struct addrinfo *ai; > + char servport[6]; > + int retries = 0x10; /* nice round number */ > + int sk, ret; > + > + snprintf(servport, sizeof(servport), "%hd", port); > + ret = getaddrinfo(server, servport, NULL, &ai); > + if (ret) > + return ret; > + > + sk = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol); > + if (sk < 0) > + goto free_ainfo; > + > + ret = connect(sk, ai->ai_addr, ai->ai_addrlen); > + if (ret < 0) > + goto close_sk; > + > + ret = KSFT_FAIL; > + while (retries--) { > + uint8_t buf[0x100000]; > + long current, sock; > + > + if (read(sk, buf, sizeof(buf)) <= 0) > + goto close_sk; > + > + current = cg_read_long(cgroup, "memory.current"); > + if (current < 0) > + goto close_sk; > + > + sock = cg_read_key_long(cgroup, "memory.stat", "sock "); > + if (sock < 0) > + goto close_sk; > + > + if (values_close(current, sock, 3)) { > + ret = KSFT_PASS; > + break; > + } The test is flapping (at least on my dev machine) because of this condition. I believe it's because of the batching we're using on the page charge path. So, in theory, it should be possible to calculate the maximum difference like num_cpus * PAGE_SIZE * batch_size. Alternatively, just bump allowed error percentage :) > + } > + > +close_sk: > + close(sk); It would be great to check that sock and current are getting 0 values after we're closing the socket. Thanks!