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=-6.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 0DA45C433C1 for ; Fri, 26 Mar 2021 11:23:02 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8B1CB61581 for ; Fri, 26 Mar 2021 11:23:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8B1CB61581 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 8BF7C6B0036; Fri, 26 Mar 2021 07:23:00 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 86FF56B006E; Fri, 26 Mar 2021 07:23:00 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6C2186B0070; Fri, 26 Mar 2021 07:23:00 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0142.hostedemail.com [216.40.44.142]) by kanga.kvack.org (Postfix) with ESMTP id 4E1346B0036 for ; Fri, 26 Mar 2021 07:23:00 -0400 (EDT) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 03546A775 for ; Fri, 26 Mar 2021 11:23:00 +0000 (UTC) X-FDA: 77961788520.14.06E22D0 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf13.hostedemail.com (Postfix) with ESMTP id 85566E0011ED for ; Fri, 26 Mar 2021 11:22:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616757778; 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=OsSdor4iOn3wE/vmbTNzxWFNNPpgZQ/EbRHURgPBcHM3WmzRiFz0OlQZp9/1fz6GYiwFDZ 7X+9RTGsEufmRfyoxak/wmb8X5l2mrOPRkCBKJ5rPeHzzaxX18EOU/5tfXiQ8G+w6xEolR W6okuKHQWjD17b+XoHW4FNIQhQ+AnpM= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-121-g4CmBk81MM6TnB__OzLg0A-1; Fri, 26 Mar 2021 07:22:56 -0400 X-MC-Unique: g4CmBk81MM6TnB__OzLg0A-1 Received: by mail-wr1-f70.google.com with SMTP id o11so4109304wrc.4 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=OUOjzHweX5wKuhKgNVvzsqyJpLRCFNkJ72ZOHEycTUrF1HIQDe9vdj1xkIzeyRKg++ OxsieXL0KhF8nLpboFRrGmdNhV0JZFE2lJI6QM7yV7zeIjLS2uDcOgncL7GkpTwL8fsO xhQNweiJXDgwSA3t/j7DmA93wPukrM/CoIZYhitgXWlrCeB88hG1CrtRo4MbNuJUo3wk nSIJnfeHoollKIQMckORynnrnWKJHfjrAWOFTNdzXqaAVYfpyYXL68fGw4hpj2HPZ6bI 5CJVhlllwKf0nYkcapXAyD9oiyvfPFAz8UTZc5k5sHNOOoaj2GzxZxdI77ngRg6sa7sF Wyxg== X-Gm-Message-State: AOAM531MD9CRD7C+MjxketGzxDHp3PpkOX/WX5juxewOEnNMdSVACop3 31wHugIKSPqeV0G1SLW7fvguH1yJokrM6YxKECXaBJXfxguz6PgtwfJPVDD4+RozbXdZD72TYwE AN9vS7NO68A== X-Received: by 2002:a05:600c:358c:: with SMTP id p12mr12839425wmq.159.1616757775750; Fri, 26 Mar 2021 04:22:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyKTIzA4x9VSUDtFDJCM/zLZSZ2xYIS4HRY/EwCmVLuHPBc0STeCDUbT6Q+3AHFzl5Ez5wxSQ== 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 In-Reply-To: Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=atomlin@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 85566E0011ED X-Stat-Signature: xadzad4ccohduojbrcnwes47ffjhmwt7 Received-SPF: none (redhat.com>: No applicable sender policy available) receiver=imf13; identity=mailfrom; envelope-from=""; helo=us-smtp-delivery-124.mimecast.com; client-ip=216.205.24.124 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1616757778-512039 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: 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