Received: by 10.213.65.68 with SMTP id h4csp3676143imn; Tue, 10 Apr 2018 02:54:47 -0700 (PDT) X-Google-Smtp-Source: AIpwx495NCfTueUlqJskkFJ2VUdUq9m8exM38YM/0HkY2YHUlcVdO8CdPjnFOAWEz09eayV7CrW9 X-Received: by 10.101.102.3 with SMTP id w3mr26927815pgv.200.1523354086956; Tue, 10 Apr 2018 02:54:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523354086; cv=none; d=google.com; s=arc-20160816; b=cRgrJP43OMZA2ZYQor8AQGxjJGvG97VMSvcxQQ+iK0oN9UiZT8Tywhn7mEBoj4mgQY 9OSAhFbd03hlUKEznKU0dJySeoiZsu4boXjAag5itZLiKCwzueX+rkGca1p+7wZgDf/Y BfvuPIIMmyw84/6bJSfwVz+VsbeQM3zMWz+j1ObXgy10bre50OcpCy+3zoLDD2V5kmOT 4ZxjbcigPHDoRQSZI10egpXwCikGGtOhHKQasJMqLwByz/kFVbJdYLTOsUmIud0fBHZ/ SDUIODrHwND+8R6zQ/Mct0qvDgIgOnSTISZAVtYYlCpU9nVgtl1rQqfIgW7/aYLfCyOV airQ== 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=+e2djASIsiDnO5wSPKnhUQ+OPUMY6LWTF3s0xNcKI/8=; b=OSAeladN5jHAOOLHwpbE5+ctkk7unT5sEh34K8WPCxl6eVBqrWB8sDXFIfl/2FjXlD 91mJZrYTHhPADametuyANGNlQzbiEFtzpoQKhPeNvk1Iu4CVy5zhrsShptdAodNeQstM FFMyOQMhWwrzsL52BSQYHFYjT+GZGtyMAaqWLwYNSyjGApb7BrtaACQ4zJt0s/HtAVp6 XzesZuQeUMh9ldPnqeYmqcQ/0pGZJLJpL1K8bFnYq+brNOgiJosu9oRq7aCf6f3R/FDo kPsNzTLODnnz3UUqrehtAJ6coB8QWLSjpbaw5H/5WwF3uCtd6ifdd5fw8S1OIp/TRUxO eMxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=YylSIC3m; 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 g66si1798435pfc.383.2018.04.10.02.54.08; Tue, 10 Apr 2018 02:54:46 -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=YylSIC3m; 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 S1752482AbeDJJvR (ORCPT + 99 others); Tue, 10 Apr 2018 05:51:17 -0400 Received: from mail-wm0-f43.google.com ([74.125.82.43]:33583 "EHLO mail-wm0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752412AbeDJJvP (ORCPT ); Tue, 10 Apr 2018 05:51:15 -0400 Received: by mail-wm0-f43.google.com with SMTP id o23so20932656wmf.0 for ; Tue, 10 Apr 2018 02:51:15 -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=+e2djASIsiDnO5wSPKnhUQ+OPUMY6LWTF3s0xNcKI/8=; b=YylSIC3mLN8vcmj9JMgMtzV5NyfBUnvd49gJUBMGAR+bQh1UgLS59Hzjypq1vQ2GqD 6bZ49D66Lc3Ys1IybmXWkKqqboqjR+CCtWHo2AQHPSTDHHIjc/+Ms0k9CVMOCWG53oZ3 Bkd8C5AoQam2kztJKKqWXBCgX50f2yxULy9eHS71daSFN3ap3/bYZ0adxJe8ae7QcY0V BoZaYSSlEdm6wyXTxROYJex/msti48InzECXNy/sisW9HmqmeHFHBf/db5SWvXkxpPHL FvWo60KdT3NPV9R0twpAmlONgvvbbQTUay+U9rA2fnJgAlrvKpXZQ/+4R5iRT6XcuM+G 9h9Q== 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=+e2djASIsiDnO5wSPKnhUQ+OPUMY6LWTF3s0xNcKI/8=; b=J/Yb9pcch+ftQTDPX/DOc08cYCm99vjo1ZNcnwhgZ6Acu7a1j4uSX0inQDsqJsqmbr MK2hhDszDEfM/IcUqeLAHneXWSQufHeZ8MbWkHDeP7epEu0uA3bLU4EyCS4Q3wZyJVwE do2cVPyV+NVuQveZM6gC64Yj58MLXKlaX7Qy3ekoLPXzF48aWrvIjzGfUbcUxrZ83f+q 67Rx9fPOW0Wv1TJ+Z01kqbuBGHJQnTFik7zdr9KvhruqXqqXmaW9tNk8nRTvxEvY1TcB s7fj5sm1to/+xKYI64c0IQrXB9kfMMcKWndBLSt3n9AzXQxBerTr4QhBZmGyhlqMqsoX haqg== X-Gm-Message-State: ALQs6tCrVuqsziuMIfUgnHTR1wpPu4cgLrhImT34TZFUdyIAhR+IwJxt cWY3IKlSofUSvm4OrSaePqniI2lzMxMOKJteFi0= X-Received: by 10.80.244.167 with SMTP id s36mr2224122edm.262.1523353874416; Tue, 10 Apr 2018 02:51:14 -0700 (PDT) MIME-Version: 1.0 Received: by 10.80.201.76 with HTTP; Tue, 10 Apr 2018 02:51:14 -0700 (PDT) In-Reply-To: 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:51:14 +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:32 PM, Zhaoyang Huang wrote: > 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 To summarize the patch sets as 'let the updater take the responsibility itself, don't harm to the innocent, but absolve the critical process'