Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp231947pxb; Tue, 31 Aug 2021 20:06:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyIc2uezf7+LjSzNO61FYT8sF/GWwOp2ZpOCSBQgTHOVIPz4feK90esp47OtxbJZwY//Ax/ X-Received: by 2002:a02:93aa:: with SMTP id z39mr5735468jah.29.1630465587932; Tue, 31 Aug 2021 20:06:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630465587; cv=none; d=google.com; s=arc-20160816; b=TK9OzM2ZITuH1BpP4uzCAlSEYSOKagJcQyRqXaUaUQBu5Ibxt2mobaSgnlDmonVTLX +jeJIK5dxFnySj8osbFJ5a4a8Gkq9B1HaerdXyvtlfT+jTN+2i/2VvLGdjrFre34Gv65 VfeokKz72cKSzm6J6ElFXq8EaNetHVHwzi25CY8Tdrrkk8WtJVIRnix0SPniV1o9/HM9 Z7P5ZkTIIocFMQYBm3lN9UWA7P66oMN54SqvBwp4sO93z94KBqX1yTf3LI7bIkEi+McD OnukzlgGeOHpm2kh4SLqDauSb7TFU01Aj8uTBaPVPIFAnH9jyutnbUmGGmapYxXJgb1u QkNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=06XNUMUAxRmFLlomXhKT58dF0EOOFvoCq/6/flpnD3A=; b=PDiA4uYogBHG4rTmNM94CIQhusfe0txV25MAZYvm+GN///E98/zPqb4hRR47g1AIWa 8hgZOFzMxHCz3P4+DuCGm58ChnOeD3vEH4V8WMQq1jCxFZrfCTkBYKAe73HAEMC8YqkA PkE3mlPU+Widwt/Zb9noHt35OEy2/Vd6HKpt93ZZ9YrQzhwvGPo46AWbp6D5h7xYu75W dP1xvHAZeQ/b9NYvJ5wHZ00KlaIpB9eS7Vg6fgCUY958B0gdEJvRN19yuO4ujTKNaiF/ RJA8HAwQd8vO/F8N2NDp3+LOMS9WN1r9blH/buLPzimJchjBiwy9Mo5sBhrxg7y4SkuX /ULA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y28si19129278iot.48.2021.08.31.20.06.16; Tue, 31 Aug 2021 20:06:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241660AbhIACpB (ORCPT + 99 others); Tue, 31 Aug 2021 22:45:01 -0400 Received: from mga17.intel.com ([192.55.52.151]:6423 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231613AbhIACpB (ORCPT ); Tue, 31 Aug 2021 22:45:01 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10093"; a="198843984" X-IronPort-AV: E=Sophos;i="5.84,368,1620716400"; d="scan'208";a="198843984" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Aug 2021 19:44:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.84,368,1620716400"; d="scan'208";a="531611425" Received: from shbuild999.sh.intel.com (HELO localhost) ([10.239.146.151]) by FMSMGA003.fm.intel.com with ESMTP; 31 Aug 2021 19:44:03 -0700 Date: Wed, 1 Sep 2021 10:44:02 +0800 From: Feng Tang To: David Rientjes , Michal Hocko Cc: Michal Hocko , 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 Message-ID: <20210901024402.GB46357@shbuild999.sh.intel.com> References: <1630399085-70431-1-git-send-email-feng.tang@intel.com> <52d80e9-cf27-9a59-94fd-d27a1e2dac6f@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <52d80e9-cf27-9a59-94fd-d27a1e2dac6f@google.com> User-Agent: Mutt/1.5.24 (2015-08-30) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi David and Michal, On Tue, Aug 31, 2021 at 06:06:17PM -0700, David Rientjes wrote: > 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. Thanks for sharing the case, the DMA case is quite simliar. And in our usage, the allocating task is finally killed after many OS routine/GUI tasks get killed. > So I'd agree in this case that it would be better to simply fail the > allocation. I agree with yours and Michal's comments, putting it in the OOM code is a little late and wastes cpu cycles. > 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? Will explore more in this direction, thanks! - Feng