Received: by 10.213.65.68 with SMTP id h4csp3662291imn; Tue, 10 Apr 2018 02:37:14 -0700 (PDT) X-Google-Smtp-Source: AIpwx499eL268sK6BNa2T7bo+LyySo+LKLmBwS7rJxP9TuQEsyD/E5WD/De2RAnpPlI4L8hrcR9N X-Received: by 2002:a17:902:6a81:: with SMTP id n1-v6mr42187987plk.342.1523353034347; Tue, 10 Apr 2018 02:37:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523353034; cv=none; d=google.com; s=arc-20160816; b=rPGgnC/8dXaWUI1R/Wm4/dA0Xx2324rzKOS/ARDci738C25SMHL57nS/hxmwnJ25AL kh5PzxCMWs7pWcOVbGXQMNL4SO+0rWbTvoXQ3BQZPajohoRlud31ut6a5w7m+NIir4Mz IrdJqNhUmAYsNj4dBZvvVxSKOYZ3loVn6Df4ncjuXZpOSHbuzbh6nkPUpIh22zDynSZx czsjqGnHwDvP1U3fzySFhsHL3cvBBhvo7hBPpxIAmBFrPNLeeGVQf90WquEArkYqY82u eOExhfHegajAXdfXkleN8JwK6jq1iU/NzPW1CFxQAtQTASQQ3Bpn4VVaDWMjEUfwqW0H 1ydQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=VP5VC/1KxL+uQE9aOQfW+g7nfMxfOCBNyPJSKLE0ziQ=; b=kWxT4C1Oc/IYeOWPePN14kInmkRg/HDoOfqG0JVDLugLO5lZz/s9x2AHmMIkCJzyHH C2O9P6Y+u71uNM1Yeh0jQF4TNGIIEu+HwsfdZ10qPY1Uk4g6+rVsl9IAb1whFzXhRmoo WWtEHcXDbbUZ9ClU7A9JA9m35FNNn5Mkhv8NVcGiznwrZxoGWH5qB6FHxmnyOF12+Qf+ lizs9Y3QJwMeXhtjI4oOoSC3DnlJKLmDXkmZKewlu7m0AffPTzS76I1Ti6viBhBZ5UAj 7i5GD3UmAt92EFgk8GIV1rhQS4i497t/DyT2DC/yJeywUCO0WY1ivoAqQ2IweQjtV4mN 6RBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=cnaO5A1t; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z1-v6si2160121plb.101.2018.04.10.02.36.37; Tue, 10 Apr 2018 02:37:14 -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=@gmail.com header.s=20161025 header.b=cnaO5A1t; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752610AbeDJJct (ORCPT + 99 others); Tue, 10 Apr 2018 05:32:49 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:54939 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751770AbeDJJcq (ORCPT ); Tue, 10 Apr 2018 05:32:46 -0400 Received: by mail-wm0-f65.google.com with SMTP id r191so24598667wmg.4 for ; Tue, 10 Apr 2018 02:32:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=VP5VC/1KxL+uQE9aOQfW+g7nfMxfOCBNyPJSKLE0ziQ=; b=cnaO5A1tbhFPmg1JuhpoEUp9Nfc25RW2Gde1le+G4ilyiLlXT0Z1DMGAR6VS+0eozN ZtkQfeOun0HOo8sqypeY1zv9r29y/kU46GnTK7kElD/5kx8ecApoAO5g2E4RzK3zPTVJ ike01ZNvhMidRQPEF/bp2qlNjyx/KnfK+aXPJlJei9VH9MjG6XfXfhZIJRhaGchAOKuu eMP37VkgxrBHeX9zJLtIYTq3yEKXQmp9yHshuNEO+5lxFZlcOOBQ3PwtIUUm0UpvgDTH Hf28ahixguhoD5Rp0YdtN7yw5drMdKjWaWtVSZXSfFOYmdxpd6F4kVZ1dvObZHLsrBgJ k0lA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=VP5VC/1KxL+uQE9aOQfW+g7nfMxfOCBNyPJSKLE0ziQ=; b=bV9JZv5aFt1SqFwTjZTCJSVyiDxuOj6Xmv0YYFAwWuT1T561E274ALdbAsYSxGlcNF 7F8NCbMIzUC35zGS4MTnEPlO1WHVDo2btU79UdaIxKHB1dCmmHbabcg4Ei4FLtYTqxiw yFslPXhxF78dOMJZN9d1lBUKAO5P8lNYtuIF4oMIJRZksHizhN21kd66yXIljEkRXTWp uYxdqOe4vjvGVK563+mh9pjGbHPBsTEA/OOIyBPVtYiZ0JgZOgurw7dEqRSvHnnoHKWp 8/yx8ni4QEq2lBQ7ypwAFVMW22jNn5VASq7Gztqc4tP/2pL45aNNfH5ygamg0RNhglEi ysgA== X-Gm-Message-State: ALQs6tD9D1hvC0iFCOCExqPu5HegxHD0/x0Z1WJsZidqLvzOG5fDBR7m pLfpMzhRwVpteDHGuwEPFgWwFl29BG2IY1EJW+A5JA== X-Received: by 10.80.244.167 with SMTP id s36mr2147276edm.262.1523352764965; Tue, 10 Apr 2018 02:32:44 -0700 (PDT) MIME-Version: 1.0 Received: by 10.80.201.76 with HTTP; Tue, 10 Apr 2018 02:32:44 -0700 (PDT) In-Reply-To: <20180410090128.GY21835@dhcp22.suse.cz> References: <20180409231230.1ab99e85@vmware.local.home> <20180410061447.GQ21835@dhcp22.suse.cz> <20180410074921.GU21835@dhcp22.suse.cz> <20180410081231.GV21835@dhcp22.suse.cz> <20180410090128.GY21835@dhcp22.suse.cz> From: Zhaoyang Huang Date: Tue, 10 Apr 2018 17:32:44 +0800 Message-ID: Subject: Re: [PATCH v1] ringbuffer: Don't choose the process with adj equal OOM_SCORE_ADJ_MIN To: Michal Hocko Cc: Steven Rostedt , Ingo Molnar , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 10, 2018 at 5:01 PM, Michal Hocko wrote: > On Tue 10-04-18 16:38:32, Zhaoyang Huang wrote: >> On Tue, Apr 10, 2018 at 4:12 PM, Michal Hocko wrote: >> > On Tue 10-04-18 16:04:40, Zhaoyang Huang wrote: >> >> On Tue, Apr 10, 2018 at 3:49 PM, Michal Hocko wrote: >> >> > On Tue 10-04-18 14:39:35, Zhaoyang Huang wrote: >> >> >> On Tue, Apr 10, 2018 at 2:14 PM, Michal Hocko wrote: >> > [...] >> >> >> > OOM_SCORE_ADJ_MIN means "hide the process from the OOM killer completely". >> >> >> > So what exactly do you want to achieve here? Because from the above it >> >> >> > sounds like opposite things. /me confused... >> >> >> > >> >> >> Steve's patch intend to have the process be OOM's victim when it >> >> >> over-allocating pages for ring buffer. I amend a patch over to protect >> >> >> process with OOM_SCORE_ADJ_MIN from doing so. Because it will make >> >> >> such process to be selected by current OOM's way of >> >> >> selecting.(consider OOM_FLAG_ORIGIN first before the adj) >> >> > >> >> > I just wouldn't really care unless there is an existing and reasonable >> >> > usecase for an application which updates the ring buffer size _and_ it >> >> > is OOM disabled at the same time. >> >> There is indeed such kind of test case on my android system, which is >> >> known as CTS and Monkey etc. >> > >> > Does the test simulate a real workload? I mean we have two things here >> > >> > oom disabled task and an updater of the ftrace ring buffer to a >> > potentially large size. The second can be completely isolated to a >> > different context, no? So why do they run in the single user process >> > context? >> ok. I think there are some misunderstandings here. Let me try to >> explain more by my poor English. There is just one thing here. The >> updater is originally a oom disabled task with adj=OOM_SCORE_ADJ_MIN. >> With Steven's patch, it will periodically become a oom killable task >> by calling set_current_oom_origin() for user process which is >> enlarging the ring buffer. What I am doing here is limit the user >> process to the ones that adj > -1000. > > I've understood that part. And I am arguing whether this is really such > an important case to play further tricks. Wouldn't it be much simpler to > put the updater out to a separate process? OOM disabled processes > shouldn't really do unexpectedly large allocations. Full stop. Otherwise > you risk a large system disruptions. > -- It is a real problem(my android system just hung there while running the test case for the innocent key process killed by OOM), however, the problem is we can not define the userspace's behavior as you suggested. What Steven's patch doing here is to keep the system to be stable by having the updater to take the responsbility itself. My patch is to let the OOM disabled processes remain the unkillable status. > Michal Hocko > SUSE Labs