Received: by 10.213.65.68 with SMTP id h4csp3371623imn; Mon, 9 Apr 2018 20:15:56 -0700 (PDT) X-Google-Smtp-Source: AIpwx48E6gxZ8xQnWfVN2rHsIGyrQIp1el+X2wwamwkF2SBuYUrAoT4SZycjA4QElbNAGpq/aZxf X-Received: by 10.98.210.7 with SMTP id c7mr1252524pfg.92.1523330156059; Mon, 09 Apr 2018 20:15:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523330156; cv=none; d=google.com; s=arc-20160816; b=RNkJkFB/kSBnlb8Tv/6TZh2BuEGnbsfH1Zb9T7634S29YD+Y8JikVt7oPhpHOlbyrD am1p8zZv5XYzVdq0qLhTviLCcg0bX0s//5+bm+4U1x5ChG8mxC3rj7V8l7eJIzjzQRP6 6OWPTk+k4tqSENMRKp3QTekcZ+A1MK4/DOdQZC5eRQE6Q271uFA3jRcqAbLHOiONLfso c0CC8McA6dBteQ1wwsTwlBDTGdgKQArbjdob0ouHkSAls75WNEnDSkGiE/7YSHRdsiOg QJznB71CpSwrkpSDpD+ZTwcqkd160h259HMVOK+mbkG5ThqXtXnllkiW6njC5zl13Eef jw+Q== 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:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dmarc-filter:arc-authentication-results; bh=7EQsJHONOROpnUp6cPt7Maxqq+DRQfxIwOjNJisgHsc=; b=O6k44EXYB65HHupZlZ1ymsn+lSZUcQDIPQtk6JoaYqlQSNn9DZ+pWcdTx2cBUsJpZW gGEXM1Ug04g98FNvH/NgO5d/19UBOv54/0kZkVIrjZVOU9RVZbg6UvcoFFRyI3Gcjnzy wX8hM49nZSxJ+8vnXx12ppbVlFG+l5cGyrd7mm+u15hxQIU4uFehZk4x2d1aIHcHgcEt N9nlbnZQu2uAYkMTUTu1Y0coc5PBVy/FO4LkzpfcAnlVQFKhriILK8rr1y09OMd2q4qu mY75pTN0/q+204HbLl3jB1ovrqT8HkM2OQEg43V2no5NzaclNOA6e8mBHx2IHyAaQRrx ffTw== 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 a14-v6si1538718plt.341.2018.04.09.20.15.17; Mon, 09 Apr 2018 20:15:56 -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 S1751916AbeDJDMe (ORCPT + 99 others); Mon, 9 Apr 2018 23:12:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:37206 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751757AbeDJDMd (ORCPT ); Mon, 9 Apr 2018 23:12:33 -0400 Received: from vmware.local.home (cpe-66-24-56-78.stny.res.rr.com [66.24.56.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1B3E921725; Tue, 10 Apr 2018 03:12:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1B3E921725 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=goodmis.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=rostedt@goodmis.org Date: Mon, 9 Apr 2018 23:12:30 -0400 From: Steven Rostedt To: Zhaoyang Huang Cc: Ingo Molnar , LKML Subject: Re: [PATCH v1] ringbuffer: Don't choose the process with adj equal OOM_SCORE_ADJ_MIN Message-ID: <20180409231230.1ab99e85@vmware.local.home> In-Reply-To: References: <1523153783-20579-1-git-send-email-zhaoyang.huang@spreadtrum.com> <20180407234812.2bf2b24b@gandalf.local.home> <20180408084717.62ee4f9e@gandalf.local.home> <20180409094944.6399b211@gandalf.local.home> X-Mailer: Claws Mail 3.15.1 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 10 Apr 2018 10:32:36 +0800 Zhaoyang Huang wrote: > For bellowing scenario, process A have no intension to exhaust the > memory, but will be likely to be selected by OOM for we set > OOM_CORE_ADJ_MIN for it. > process A(-1000) process B > > i = si_mem_available(); > if (i < nr_pages) > return -ENOMEM; > schedule > ---------------> > allocate huge memory > <------------- > if (user_thread) > set_current_oom_origin(); > > for (i = 0; i < nr_pages; i++) { > bpage = kzalloc_node Is this really an issue though? Seriously, do you think you will ever hit this? How often do you increase the size of the ftrace ring buffer? For this to be an issue, the system has to trigger an OOM at the exact moment you decide to increase the size of the ring buffer. That would be an impressive attack, with little to gain. Ask the memory management people. If they think this could be a problem, then I'll be happy to take your patch. -- Steve