Received: by 10.213.65.68 with SMTP id h4csp4140026imn; Tue, 10 Apr 2018 09:49:30 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/7W4DZzHqwkmTcqFZShZqbVfearClmytSiaH6J3Xt0bac5Fxkzgugc0Tm3FTc/iZAq3Mf1 X-Received: by 2002:a17:902:41:: with SMTP id 59-v6mr1262448pla.248.1523378970472; Tue, 10 Apr 2018 09:49:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523378970; cv=none; d=google.com; s=arc-20160816; b=o4I+28B6+SyK7y8zP58QrtAz87Yg7kKc9Dn7nrTzqOi2RYvbJ2SQQ3Z7TlU52l4oZH gVEFLLtKAPJqdkVxzlnT2Hq8Gaor3Ce2i2VavaD7UpIDxKkpm1oAADyNOqxZJUuXVx4a lrmBLEFtFpRdcPPiPFFcvW3zexDUo/1N/L18pJerSUOap0DdtjqXEHqBF7mVpp1p6bxb miY/AsChIcd33P/YJ0fjqFML9pU/YPb5U+G1m+A9aUS4FxqVclW8Uhvftyv8NLrTZkSj QUKdHfiasyjVisIxcAcAokluON5uSuY3BZhymH1Pgff2YLjSGw6KliS79NqWe229pXp3 Ebjg== 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=1FKJ6cN9NJzKrJ61h5m6Jv3RDJvjLBTmYlawXMbTiew=; b=a6vTIo4uOEcLYymtzsmEmK1ap65J0ChusmNLOi5TFapt7LROXBwDki2dvUKl6dJNBP zUkLBn8HGUiXK9olK6xl3mqAxGq06snGiWN9ut2jMeJPj4H5/1AG4yJEUUTAZKaYVrhm UIiQQdntoimcVLVR673kOpXZWROIS/BCbNqBCW+FO9W4GP6UTQ+wgjrBI7Fmjqjv68gj 8NRPuCxp2Zzk2hf3EL/s3ryht8gcallW7j6JitBuCUF5zi31ezyUXNe96+lYktQC+ESd uEXRgJ+GTECUlqfaKf1kSx+9kvfOnPDj4XUK9LninE6Nrg1op7hyF9qdjHe6CZQOkiIV rNNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=hSql7KdY; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b3-v6si3032082pld.2.2018.04.10.09.48.53; Tue, 10 Apr 2018 09:49:30 -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=@google.com header.s=20161025 header.b=hSql7KdY; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751876AbeDJQp5 (ORCPT + 99 others); Tue, 10 Apr 2018 12:45:57 -0400 Received: from mail-io0-f171.google.com ([209.85.223.171]:32774 "EHLO mail-io0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751490AbeDJQp4 (ORCPT ); Tue, 10 Apr 2018 12:45:56 -0400 Received: by mail-io0-f171.google.com with SMTP id p139so14439060iod.0 for ; Tue, 10 Apr 2018 09:45:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=1FKJ6cN9NJzKrJ61h5m6Jv3RDJvjLBTmYlawXMbTiew=; b=hSql7KdYnID/8vzV5gPUoywRfKyFgGbrbGjlA0+Cli4GOM1G9waGXTPd3lAZjuOJxg yYUknOmBFDegBqAbpxvWT4UoZPc1pB5ldXn4I3HOsy9e5//iDNH339/iholDewRzVVbd vD41/I0r8a6/jP4HNyYa41CcxeEUTXaEUH0NP0+l9arzVcgVbzjm3y99i3aC0JLKh65n naBRg6TAgV6HFVCk4q0Dm5SZtrj4T0qVqt4O9wKuI8PmSd+zXPj+2Tq8WRadCtzyk6hH /HnOBkPftn5Mn6xFQMjHHf0w2EJXek0SSvSUtbi6hC5cAGc5O4agKM5y3JSRPyrS9TOx cXHA== 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=1FKJ6cN9NJzKrJ61h5m6Jv3RDJvjLBTmYlawXMbTiew=; b=rbjHdl44LeOpMfW2ynchM1gonjgcdRyynY9g4hXk0MLNG0BalLqUfOtTTiKWidhb06 Ekbh52+Oag1MQjuCG72Q4apC8IqjfjZLIuJbx9/raXAvI7SyvO7IPbYxQfyzfjzgl3ad tbr5ErcvIS0ykYXBvgkweovddcO6HyJUH6hbmXFS0qEYibPW0gntrGHcxQglcir7xhJs PkG1lJV5KoWkmHtAsjBR89J5Q021/mcjAcJaSbSPbdAD/Gub4jFqvsT5LzK9oI28vNhf kKj5muBEgdvm+FEN4d/CZBGoZP+HdinntQSaXnPGUDEBfmZUE9lcmaXoJH4LaF5AbAeM ZKRQ== X-Gm-Message-State: ALQs6tA0mcnT8ORFYXLUiR8pVUKEr/q5/faoFhnqLzAQkgQr7Fsbdrwv pktRHGRJZrruzpKvkHGehkSLdcBX6iNdmipfrcC5bw== X-Received: by 10.107.58.134 with SMTP id h128mr1240370ioa.299.1523378754804; Tue, 10 Apr 2018 09:45:54 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.11.158 with HTTP; Tue, 10 Apr 2018 09:45:54 -0700 (PDT) In-Reply-To: <20180410091311.20bd8ccc@gandalf.local.home> References: <20180410061447.GQ21835@dhcp22.suse.cz> <20180410074921.GU21835@dhcp22.suse.cz> <20180410081231.GV21835@dhcp22.suse.cz> <20180410090128.GY21835@dhcp22.suse.cz> <20180410104902.GC21835@dhcp22.suse.cz> <20180410082316.263d34ec@gandalf.local.home> <20180410122706.GH21835@dhcp22.suse.cz> <20180410083625.2c904ab2@gandalf.local.home> <20180410091311.20bd8ccc@gandalf.local.home> From: Joel Fernandes Date: Tue, 10 Apr 2018 09:45:54 -0700 Message-ID: Subject: Re: [PATCH v1] ringbuffer: Don't choose the process with adj equal OOM_SCORE_ADJ_MIN To: Steven Rostedt Cc: Michal Hocko , Zhaoyang Huang , 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 Hi Steve, On Tue, Apr 10, 2018 at 6:13 AM, Steven Rostedt wrote: > On Tue, 10 Apr 2018 08:36:25 -0400 > Steven Rostedt wrote: > >> On Tue, 10 Apr 2018 14:27:06 +0200 >> Michal Hocko wrote: >> >> > I would rather that the code outside of MM not touch implementation >> > details like OOM_SCORE_ADJ_MIN. It is really hard to get rid of abusers >> > whenever you try to change something in MM then. Especially when the >> > usecase is quite dubious. >> >> Fair enough. I was reluctant to use the OOM_SCORE_ADJ_MIN in this case. >> >> Perhaps I can create an option that lets users decide how they want to >> allocate. >> >> For people like Joel, it will try hard (by default) and set oom_origin, >> but the user could also set an option "no_mem_reclaim", where it will >> not set oom_origin, but will also use NORETRY as well, where it wont >> trigger OOM and will not be the designated victim of OOM. But it will >> likely not allocate memory if the system is under heavy use. Then for >> Zhaoyang's tests, all he has to do is to set that option (or clear it, >> if the option is "mem_reclaim", which is what I'll probably call it). >> > > > Something like this: > > -- Steve > > diff --git a/include/linux/ring_buffer.h b/include/linux/ring_buffer.h > index a0233edc0718..807e2bcb21b3 100644 > --- a/include/linux/ring_buffer.h > +++ b/include/linux/ring_buffer.h > @@ -106,7 +106,8 @@ __poll_t ring_buffer_poll_wait(struct ring_buffer *buffer, int cpu, > > void ring_buffer_free(struct ring_buffer *buffer); > > -int ring_buffer_resize(struct ring_buffer *buffer, unsigned long size, int cpu); > +int ring_buffer_resize(struct ring_buffer *buffer, unsigned long size, > + int cpu, int rbflags); > > void ring_buffer_change_overwrite(struct ring_buffer *buffer, int val); > > @@ -201,6 +202,7 @@ int ring_buffer_print_page_header(struct trace_seq *s); > > enum ring_buffer_flags { > RB_FL_OVERWRITE = 1 << 0, > + RB_FL_NO_RECLAIM = 1 << 1, But the thing is, set_oom_origin doesn't seem to be doing the desirable thing every time anyway as per my tests last week [1] and the si_mem_available check alone seems to be working fine for me (and also Zhaoyang as he mentioned). Since the problem Zhaoyang is now referring to is caused because of calling set_oom_origin in the first place, can we not just drop that patch and avoid adding more complexity? IMHO I feel like for things like RB memory allocation, we shouldn't add a knob if we don't need to. Also I think Zhaoyang is developing for Android too since he mentioned he ran CTS tests so we both have the same "usecase" but he can feel free to correct me if that's not the case ;) thanks, - Joel [1] https://www.spinics.net/lists/linux-mm/msg149227.html