Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1251554pxf; Fri, 26 Mar 2021 04:27:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyeNypkoQVBaQxB27c2J1o2M2PNhpKJOXPt5eNgsb7RdmiyWMior/Me9VNM0VDpVUnHOKb8 X-Received: by 2002:a17:906:b2d6:: with SMTP id cf22mr14672236ejb.321.1616758033394; Fri, 26 Mar 2021 04:27:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616758033; cv=none; d=google.com; s=arc-20160816; b=Boai9SnrlP+Wul5k5WVdtRg/c2lVOgySsgBl2ujXZRjZNa/u9D8sjSs4gpSltkrgvh bxmcYSI0hoqkcdoFRi2PMi1JT0XIW63s5R1WykGthGqD+0YQHfs63GUYMAz4l7ommMmM FFji4MylEd+JCWwraN+U9hq3/RfzTcAbPrmpFLKvhAmHVFOhTwxqZih0zFJeWiIrTiyi f+Bo/wyncenxz6w9whfcTojx03o2pkAeLILj0Psivw4Z16PnfXM487hox0yv1mYqKDBF CHlWJ/AyAJDxaQbKk6ecEIqcYjiD6DejVgNJ21XL5emNH5hjDN2axvMx4aL+Y9IjWZi2 zS6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=170aP5yspNLVYsVCQJ6t8wrVkNIt5w9MEL3rQNGkYMY=; b=FsUgcaL39Mts81lXGo3G0k+mBvo/J7qNsCXnhIxz0+F9um7gAR5BbhQHKMi7Brg7hV wjnMZnt1AZQgcr3hiGkg6am2n6jOt53oqLX+24p5lGtZkqfL2kMLrah7gsARh3W8cRR5 g/GVcayQLkllOL70TRHr2P6cCpLK7zpQ2PhBK4t+tilQU1/05Nb82yUfOvoG5pQkELfN wCvjARqA10YUXeCBjGPcPT90Z7z2swlGmk7+RY0ePCpbkMj/9X4J9ularuigMp0QjGYk qdsSU26AyutBxct7h4tuFoWHnj7BxVsTJJkmJT5Ak5T6EQ9BKMqFYdhvM9wW/v4nBaaH 3lkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=EeVl45fX; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ds18si6785286ejc.311.2021.03.26.04.26.50; Fri, 26 Mar 2021 04:27:13 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=EeVl45fX; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229906AbhCZLXV (ORCPT + 99 others); Fri, 26 Mar 2021 07:23:21 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:23834 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229882AbhCZLW7 (ORCPT ); Fri, 26 Mar 2021 07:22:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616757779; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=170aP5yspNLVYsVCQJ6t8wrVkNIt5w9MEL3rQNGkYMY=; b=EeVl45fXhNsouZBTN3GKtq7xk+Xc1QBQ98JwQC/POLLEx7UTIX7Cs3StyN2MBAIXGf3OSP 4Zn0F727/9jOTQX2Mv0Ml4UUDYcpijFL6IG/D4IFU/0vt36jDu3uf7jeqMWhEVV4OJS24i RbL+mz1RmiRvuHSjxTSQLXORPPTKJUs= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-152-Tk4Y_CAVMseLWBtB-m7D2g-1; Fri, 26 Mar 2021 07:22:56 -0400 X-MC-Unique: Tk4Y_CAVMseLWBtB-m7D2g-1 Received: by mail-wm1-f72.google.com with SMTP id f9so524459wml.0 for ; Fri, 26 Mar 2021 04:22:56 -0700 (PDT) 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:message-id:references :mime-version:content-disposition:in-reply-to; bh=170aP5yspNLVYsVCQJ6t8wrVkNIt5w9MEL3rQNGkYMY=; b=EwNODzoudOSSw9/81wse4Ov6j9pmOQRAR4N+zU7VZ3O3pUBTWYT8lWOLuX2mpviTQ8 n6hJMx6UnzCvdvKG/2XxmbMMqi4KWno+Rf8Ao37pEeAuTTFLjOBvqLCTxsHIBWt67btS eLclNWmxHd3cTqZfnVSj+bCMavy6JFnxHryAh6UXNe4UFiv6xgCZFhJj46L/lHA33fQz 2wdKzBorbunM5eOndbNBv++60yovTkIVxqKhcWT+nLKOmWiOisrWbAMkWSu4bGL7YgIb u/IUB/x1VXMmyz9zITg2LYJlBCc/ehg/jddJ41z0HZKBncyb0wjg9ILiI02GLZ1Cu6X0 rRyg== X-Gm-Message-State: AOAM531oI1QvE+we9QuyNAqvmHxSGmLfFDtLBRNeNUCU/tyFVt/GPSaT 8WKfRlskAYOsuBF3zJw6greZJgZkAYpIAH2H/1L5JDx6zWDceC9lppHJWyWZuMfTrSnoDCFlpDm AY0sa5U7231mW99WMHpk8ANo= X-Received: by 2002:a05:600c:358c:: with SMTP id p12mr12839423wmq.159.1616757775749; Fri, 26 Mar 2021 04:22:55 -0700 (PDT) X-Received: by 2002:a05:600c:358c:: with SMTP id p12mr12839410wmq.159.1616757775548; Fri, 26 Mar 2021 04:22:55 -0700 (PDT) Received: from localhost (cpc111743-lutn13-2-0-cust979.9-3.cable.virginm.net. [82.17.115.212]) by smtp.gmail.com with ESMTPSA id k12sm12442530wrx.7.2021.03.26.04.22.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Mar 2021 04:22:55 -0700 (PDT) Date: Fri, 26 Mar 2021 11:22:54 +0000 From: Aaron Tomlin To: Michal Hocko Cc: linux-mm@kvack.org, akpm@linux-foundation.org, linux-kernel@vger.kernel.org, Vlastimil Babka Subject: Re: [PATCH] mm/page_alloc: try oom if reclaim is unable to make forward progress Message-ID: <20210326112254.jy5jkiwtgj3pqkt2@ava.usersys.com> References: <20210315165837.789593-1-atomlin@redhat.com> <20210319172901.cror2u53b7caws3a@ava.usersys.com> <20210325210159.r565fvfitoqeuykp@ava.usersys.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Michal, On Fri 2021-03-26 09:16 +0100, Michal Hocko wrote: > The oom killer is never triggered for costly allocation request. Yes - I agree. Looking at __alloc_pages_may_oom() I can see for a costly order allocation request the OOM killer is explicitly not used. If I understand correctly, the patch I proposed was for the following scenarios: 1. The costly order allocation request to fail when "some" progress is made (i.e. order-0) and the last compaction request was "skipped" 2. A non-costly order allocation request that is unable to make any progress and failed over the maximum reclaim retry count in a row and the last known compaction result was skipped to consider using the OOM killer for assistance > Both reclaim and compaction maintain their own retries counters as they > are targeting a different operation. Although the compaction really > depends on the reclaim to do some progress. Yes. Looking at should_compact_retry() if the last known compaction result was skipped i.e. suggesting there was not enough order-0 pages to support compaction, so assistance is needed from reclaim (see __compaction_suitable()). I noticed that the value of compaction_retries, compact_result and compact_priority was 0, COMPACT_SKIPPED and 1 i.e. COMPACT_PRIO_SYNC_LIGHT, respectively. > OK, this sound unexpected as it indicates that the reclaim is able to > make a forward progress but compaction doesn't want to give up and keeps > retrying. Are you able to reproduce this or could you find out which > specific condition keeps compaction retrying? I would expect that it is > one of the 3 conditions before the max_retries is checked. Unfortunately, I have been told it is not entirely reproducible. I suspect it is the following in should_compact_retry() - as I indicated above the last known value stored in compaction_retries was 0: if (order > PAGE_ALLOC_COSTLY_ORDER) max_retries /= 4; if (*compaction_retries <= max_retries) { ret = true; goto out; } Kind regards, -- Aaron Tomlin