From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 36975C432BE for ; Wed, 1 Sep 2021 01:06:22 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id BF87960F91 for ; Wed, 1 Sep 2021 01:06:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org BF87960F91 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 5F5818D0001; Tue, 31 Aug 2021 21:06:21 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5A4BB6B0071; Tue, 31 Aug 2021 21:06:21 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 493EA8D0001; Tue, 31 Aug 2021 21:06:21 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0175.hostedemail.com [216.40.44.175]) by kanga.kvack.org (Postfix) with ESMTP id 3A5626B006C for ; Tue, 31 Aug 2021 21:06:21 -0400 (EDT) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 0145E250B0 for ; Wed, 1 Sep 2021 01:06:21 +0000 (UTC) X-FDA: 78537213762.13.2181100 Received: from mail-pg1-f178.google.com (mail-pg1-f178.google.com [209.85.215.178]) by imf21.hostedemail.com (Postfix) with ESMTP id C4A73D0228CD for ; Wed, 1 Sep 2021 01:06:20 +0000 (UTC) Received: by mail-pg1-f178.google.com with SMTP id w8so1064371pgf.5 for ; Tue, 31 Aug 2021 18:06:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:in-reply-to:message-id:references :mime-version; bh=Bk3eA3HGoVdf+D94if6LP0AzGRhODu8sBZGMlHjTOVI=; b=AkG2kYnNbVzSk9RsfTjSiJEqdWdEqtfocVNINxY6zZrkJnFQiWZc+uyaM3kiiVXC4F bjX5H8lVU66HDKscetKfJAecVuvj38iHVVJGEzRUmUefSKDQEnuRMuzXOKoBsVXhgwG6 hRbIbtTCUwiZLEjDYzYY0tC+sbDAeKHT4ziZPW9oIyFyneiNCgJbq3LVMf47Xdjh8FGv B8KoeUCm/vjM7n9mLgMkLkNJ73Eh1TMcncnlGgqZ5OD4N4syEzq0BhuWrcYgygXKhfOL H/uE8IVyV7Qmm356LVCbOZ6IwbISeeWt5jwm3zYuSmxOYrnI5m6TPYdEm49wZAoM0kr3 hdrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:mime-version; bh=Bk3eA3HGoVdf+D94if6LP0AzGRhODu8sBZGMlHjTOVI=; b=NxPycNQ8K+x0QVYcO9ltXMNRIaVqy7FCRO3v40qRqi/dnW23Yu8MC5gKxnYeruLlPu 3t4nA6lTAZ/kRpzXi6O3u5DylNwlCsoMZsrfzkGFkXjBrqUK3Xy/0mLvWULCC98vcPpE J8SBNsH4ZGySNZNrb8/Y1GEVKw77c55ta+3nHEy6Vi23vKEBozPUqaY7jgXJv5iFvYeq heA6ZMvZTCeNRsGbuipBbt5W5/ziUjqHffAo/YdZZrdcN/hHKnew47U4yCdPWOMReTVH YSQRhvpl/qPKvnGRxewMi4Ds2cceJAfIEDki9yFcEFYurCst24eelGluo/MJIk2RnHma B/ng== X-Gm-Message-State: AOAM533PW0iRvjgtmqS19TK+i1UBBvnfVyh7aGzaMfXUF5m3aAwjUG2e MppJxK/9aM29UWz7ifp1RoHuLA== X-Google-Smtp-Source: ABdhPJzCeT5zkz7Lr8PP9zK5LKQPpz2HNH6ZJjmMS+lXV2KRtv03iYM3N2XX4S5ACF63SNzewgWckg== X-Received: by 2002:a65:620d:: with SMTP id d13mr29789947pgv.36.1630458379468; Tue, 31 Aug 2021 18:06:19 -0700 (PDT) Received: from [2620:15c:17:3:b81a:d450:f5a3:8b8b] ([2620:15c:17:3:b81a:d450:f5a3:8b8b]) by smtp.gmail.com with ESMTPSA id h9sm4296811pjg.9.2021.08.31.18.06.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Aug 2021 18:06:18 -0700 (PDT) Date: Tue, 31 Aug 2021 18:06:17 -0700 (PDT) From: David Rientjes To: Michal Hocko cc: Feng Tang , linux-mm@kvack.org, Andrew Morton , Christian Brauner , linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH] mm/oom: detect and kill task which has allocation forbidden by cpuset limit In-Reply-To: Message-ID: <52d80e9-cf27-9a59-94fd-d27a1e2dac6f@google.com> References: <1630399085-70431-1-git-send-email-feng.tang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=google.com header.s=20161025 header.b=AkG2kYnN; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf21.hostedemail.com: domain of rientjes@google.com designates 209.85.215.178 as permitted sender) smtp.mailfrom=rientjes@google.com X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: C4A73D0228CD X-Stat-Signature: d38b84mzm758jstzwd7hekhiqnz4jfn8 X-HE-Tag: 1630458380-882681 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue, 31 Aug 2021, Michal Hocko wrote: > I do not like this solution TBH. We know that that it is impossible to > satisfy the allocation at the page allocator level so dealing with it at > the OOM killer level is just a bad layering and a lot of wasted cycles > to reach that point. Why cannot we simply fail the allocation if cpusets > filtering leads to an empty zone intersection? Cpusets will guarantee our effective nodemask will include at least one node in N_MEMORY (cpuset_mems_allowed()) so we'll always have at least one zone in our zonelist. Issue in this case appears to be that the zone will never satisfy non-movable allocations. I think this would be very similar to a GFP_DMA allocation when bound to a node without lowmem, in which case we get a page allocation failure. We don't kill current like this patch. So I'd agree in this case that it would be better to simply fail the allocation. Feng, would you move this check to __alloc_pages_may_oom() like the other special cases and simply fail rather than call into the oom killer?