Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3766979imm; Mon, 15 Oct 2018 03:58:25 -0700 (PDT) X-Google-Smtp-Source: ACcGV61VBn67o0Ls120/Fxt0kAhi8dzFEoAKmJ1CMHffk42WM5urB97Szl3Z4a/+06f8U4nB3xzR X-Received: by 2002:a17:902:b58c:: with SMTP id a12-v6mr16212912pls.226.1539601104978; Mon, 15 Oct 2018 03:58:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539601104; cv=none; d=google.com; s=arc-20160816; b=oMxuHLTFmfniiWj8F4iR3lPBVUxknUVae4CbPqnW9Co58/twdfGUjgS/lnyoT3E1V5 WxTY2y4DiI2mDt8bdhPtmL/fuHi5D5Y0WT4FDWgzMjpjy+HEtuSOIIPeSNuobECOkquG dNjYLFV/GNjctlMTW6h2J6HOlQkty2TJwhdzL0wLcLbwD1jdaKROIZrjJ6QnBNY1WPDO PMrnh6Xhyrtrud7/o9CAyxGb6z3ThdQBZShTOJwTCklxsTOmgd2Zk5N5Uvv9Z5GhVQEL C1rNytQ2fTLpWFWiNnlSgaWIHi80EVxPf2FsRhmxxg6kDzxVEtGBqNSXXGFvgy/KO0W8 LpJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=F4hSYCN+24lLu3G9337tOuQuDeualYkaTTCbY7X1qFk=; b=L8lByHtIGHfMQlATNuHHvkaTXO++uEmkZJe/tOQ9s5W/Y/nTIwa8m5uhVLEoyqIjfD Nrfj5OcmReM9lyOYdIVjtKM0KFtmAwwWfQguA3+gjuiPp+M6pZpbbPxoQHeYtCB9ytcb dZauM1J+STMADo+mtbMK/8lQ7R86yA8Q6bgPnwAyCvsoM76ks7MBZE74K8vjb171E/Ao honEoifWrXUAt3x1slR8uzAc98d24BY6T7L9Qc0P5THa9NXdaOyTMpN8bsu7L9+7zja3 QZe5rnDDEf/dO2m0x5ydlnntJPzgEzrtgixSIoE1AFPmFwdC8rASo8iarzHX1xvouIRe 88tw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 15-v6si10898640pld.374.2018.10.15.03.58.10; Mon, 15 Oct 2018 03:58:24 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726597AbeJOSmb (ORCPT + 99 others); Mon, 15 Oct 2018 14:42:31 -0400 Received: from www262.sakura.ne.jp ([202.181.97.72]:46819 "EHLO www262.sakura.ne.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726273AbeJOSmb (ORCPT ); Mon, 15 Oct 2018 14:42:31 -0400 Received: from fsav302.sakura.ne.jp (fsav302.sakura.ne.jp [153.120.85.133]) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTP id w9FAvfBI011280; Mon, 15 Oct 2018 19:57:41 +0900 (JST) (envelope-from penguin-kernel@i-love.sakura.ne.jp) Received: from www262.sakura.ne.jp (202.181.97.72) by fsav302.sakura.ne.jp (F-Secure/fsigk_smtp/530/fsav302.sakura.ne.jp); Mon, 15 Oct 2018 19:57:40 +0900 (JST) X-Virus-Status: clean(F-Secure/fsigk_smtp/530/fsav302.sakura.ne.jp) Received: from [192.168.1.8] (softbank060157066051.bbtec.net [60.157.66.51]) (authenticated bits=0) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTPSA id w9FAvaPI011264 (version=TLSv1.2 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 15 Oct 2018 19:57:40 +0900 (JST) (envelope-from penguin-kernel@i-love.sakura.ne.jp) Subject: Re: [RFC PATCH] memcg, oom: throttle dump_header for memcg ooms without eligible tasks To: Michal Hocko Cc: Johannes Weiner , linux-mm@kvack.org, syzkaller-bugs@googlegroups.com, guro@fb.com, kirill.shutemov@linux.intel.com, linux-kernel@vger.kernel.org, rientjes@google.com, yang.s@alibaba-inc.com, Andrew Morton , Sergey Senozhatsky , Petr Mladek , Sergey Senozhatsky , Steven Rostedt References: <000000000000dc48d40577d4a587@google.com> <20181010151135.25766-1-mhocko@kernel.org> <20181012112008.GA27955@cmpxchg.org> <20181012120858.GX5873@dhcp22.suse.cz> <9174f087-3f6f-f0ed-6009-509d4436a47a@i-love.sakura.ne.jp> <20181012124137.GA29330@cmpxchg.org> <0417c888-d74e-b6ae-a8f0-234cbde03d38@i-love.sakura.ne.jp> <20181013112238.GA762@cmpxchg.org> <20181015081934.GD18839@dhcp22.suse.cz> From: Tetsuo Handa Message-ID: Date: Mon, 15 Oct 2018 19:57:35 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20181015081934.GD18839@dhcp22.suse.cz> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018/10/15 17:19, Michal Hocko wrote: > As so many dozens of times before, I will point you to an incremental > nature of changes we really prefer in the mm land. We are also after a > simplicity which your proposal lacks in many aspects. You seem to ignore > that general approach and I have hard time to consider your NAK as a > relevant feedback. Going to an extreme and basing a complex solution on > it is not going to fly. No killable process should be a rare event which > requires a seriously misconfigured memcg to happen so wildly. If you can > trigger it with a normal user privileges then it would be a clear bug to > address rather than work around with printk throttling. > I can trigger 200+ times / 900+ lines / 69KB+ of needless OOM messages with a normal user privileges. This is a lot of needless noise/delay. No killable process is not a rare event, even without root privileges. [root@ccsecurity kumaneko]# time ./a.out Killed real 0m2.396s user 0m0.000s sys 0m2.970s [root@ccsecurity ~]# dmesg | grep 'no killable' | wc -l 202 [root@ccsecurity ~]# dmesg | wc 942 7335 70716 [root@ccsecurity ~]# ---------------------------------------- #define _GNU_SOURCE #include #include #include #include #include #include #include #include #define NUMTHREADS 256 #define MMAPSIZE 4 * 10485760 #define STACKSIZE 4096 static int pipe_fd[2] = { EOF, EOF }; static int memory_eater(void *unused) { int fd = open("/dev/zero", O_RDONLY); char *buf = mmap(NULL, MMAPSIZE, PROT_WRITE | PROT_READ, MAP_ANONYMOUS | MAP_SHARED, EOF, 0); read(pipe_fd[0], buf, 1); read(fd, buf, MMAPSIZE); pause(); return 0; } int main(int argc, char *argv[]) { int i; char *stack; FILE *fp; const unsigned long size = 1048576 * 200; mkdir("/sys/fs/cgroup/memory/test1", 0755); fp = fopen("/sys/fs/cgroup/memory/test1/memory.limit_in_bytes", "w"); fprintf(fp, "%lu\n", size); fclose(fp); fp = fopen("/sys/fs/cgroup/memory/test1/tasks", "w"); fprintf(fp, "%u\n", getpid()); fclose(fp); if (setgid(-2) || setuid(-2)) return 1; stack = mmap(NULL, STACKSIZE * NUMTHREADS, PROT_WRITE | PROT_READ, MAP_ANONYMOUS | MAP_SHARED, EOF, 0); for (i = 0; i < NUMTHREADS; i++) if (clone(memory_eater, stack + (i + 1) * STACKSIZE, CLONE_SIGHAND | CLONE_THREAD | CLONE_VM | CLONE_FS | CLONE_FILES, NULL) == -1) break; sleep(1); close(pipe_fd[1]); pause(); return 0; } ----------------------------------------