Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7525608imu; Mon, 3 Dec 2018 14:29:45 -0800 (PST) X-Google-Smtp-Source: AFSGD/V2IQhv32A2BE3+1cTyMOAuBOwoRON5jBdcbVAc0CoGUlbXm6VDU3TZYufEfvN5VJ6ecxsx X-Received: by 2002:a63:4187:: with SMTP id o129mr13630153pga.370.1543876185487; Mon, 03 Dec 2018 14:29:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543876185; cv=none; d=google.com; s=arc-20160816; b=EbVvoVALnKZjCMEQrpxv/wI0H7NnVCrKFneu06zZQgNj9JPRpEtH2H1YZZZ2Xe2MjX R7VtHO4VR4JL/ngbj4cdXJJHUIVC6iva0vdETlWm4fCCj7g860+2JusECPdeL0klFL74 0D8wD8YP1DrDFb6hXcR6RWkAa7tzevIFI3Vs82QoSez+B+p3QWWoZoVPYP9Qw3kRl982 rM7HzJA6zx/scgCqemv3s2LGrlUjhOvBTpyZM4yF8d02R9oyfFqmO6aeVsj8Uxb7Rp1n 6zV3VhesKhiIqj+A9LAu3uPZD5a3m4KGYU3PGIvIAh4USM1hsjyudxvTveNHi9+8YJZN Wqfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=9Xcr2RaqLdt+inByx0BzSFBwe7JgSAypthxfQImB8tg=; b=EmQEuZxMSsIHx7Kae6svoJhciIncio3wUQ6QM339b9uVQAygh8lT1fkM/la/T4TYgR 5suL0YCo3sXdbxfYyi48bP6Lybhx4cs8m8VXC37+br55v7l5I5TJSKANHIfS+KZkVXri RBkT6GvDTrDOzlD53mSDJDzOMY3azFKj5aELsFPZ66zF4XbQtc68v+y+yVCXNAtVKDoH +w+Yx+TOhp8ULaTeoTmPajoHsugalk2OxYX7XITS2Q8kr1T3RqgMnPg/SCJXH2Cl1GEv I4E0akOJaRbrNiRdLXSHXjefO8Asb3RvFfhO4hYiU6k6vsGUm2AoTLdu4UiNYTR3mC+C F2UA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=QbwnoqRD; 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 l63-v6si15110118plb.385.2018.12.03.14.29.30; Mon, 03 Dec 2018 14:29:45 -0800 (PST) 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; dkim=pass header.i=@linux-foundation.org header.s=google header.b=QbwnoqRD; 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 S1726007AbeLCW1l (ORCPT + 99 others); Mon, 3 Dec 2018 17:27:41 -0500 Received: from mail-lj1-f194.google.com ([209.85.208.194]:44012 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725880AbeLCW1k (ORCPT ); Mon, 3 Dec 2018 17:27:40 -0500 Received: by mail-lj1-f194.google.com with SMTP id 83-v6so12959032ljf.10 for ; Mon, 03 Dec 2018 14:27:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=9Xcr2RaqLdt+inByx0BzSFBwe7JgSAypthxfQImB8tg=; b=QbwnoqRDRGBP+cMN0uTU7Nf45tJ3aAdfeSSTF/b68ZUaaVh1wyBpU1tuSukdrs1MAL ljZsr+gFlKxEC6G20CwY5EAXaa/z9fzvtxkPWN8Yp6oLUr8hdDiHdSrp/Euy6W9du1ky SPyub0PpB+qNMu8prjQ02aVVMjpSzyGaK53T4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=9Xcr2RaqLdt+inByx0BzSFBwe7JgSAypthxfQImB8tg=; b=rfrjk79P3eMo+OPSZLOh/YtRA49Kf1c9nJrVkC3st5NGOPRM/yLVY3VzzLGgH61IQx fQA3to7IqFx5hhj0c5PYxajBnutj3Bp25OvQPXefmhl/MGea5rlZdmKQGtzd6az22KUM E47JW3cXZ8iACWvOlzmi5EaFKLhfX8u/kZ1E1Xd+BPNOZjHSd9FliYjrgE27BTOJNvKE Sch6YFPNTFL0A9l+Ixrmglhf2aNBTNkCg9H2CYb2rcLP3sxMg37GPX6X6fpQA3TkHTz/ ES65Qxz3xeZwebKffKPiI5UXMsKgU0aEASs8CqWcVwHWvKmrfZ+ijCv6N2sPIKbVJRPC 1aow== X-Gm-Message-State: AA+aEWas3VDBiHLYyV+nlhQKeik+BanPmAESZWW86ywvqmK3nKAdvnXg ro+EVLJo6I7r1Lve+qf4NR3aaRCXFmw= X-Received: by 2002:a2e:458b:: with SMTP id s133-v6mr10957553lja.170.1543876057040; Mon, 03 Dec 2018 14:27:37 -0800 (PST) Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com. [209.85.167.52]) by smtp.gmail.com with ESMTPSA id e14-v6sm2749808ljl.43.2018.12.03.14.27.35 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Dec 2018 14:27:35 -0800 (PST) Received: by mail-lf1-f52.google.com with SMTP id z13so10420374lfe.11 for ; Mon, 03 Dec 2018 14:27:35 -0800 (PST) X-Received: by 2002:a19:c014:: with SMTP id q20mr9557667lff.16.1543876054594; Mon, 03 Dec 2018 14:27:34 -0800 (PST) MIME-Version: 1.0 References: <20181127205737.GI16136@redhat.com> <87tvk1yjkp.fsf@yhuang-dev.intel.com> <20181203181456.GK31738@dhcp22.suse.cz> <20181203183050.GL31738@dhcp22.suse.cz> <20181203185954.GM31738@dhcp22.suse.cz> <20181203201214.GB3540@redhat.com> In-Reply-To: From: Linus Torvalds Date: Mon, 3 Dec 2018 14:27:18 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [LKP] [mm] ac5b2c1891: vm-scalability.throughput -61.3% regression To: Andrea Arcangeli Cc: mhocko@kernel.org, ying.huang@intel.com, s.priebe@profihost.ag, mgorman@techsingularity.net, Linux List Kernel Mailing , alex.williamson@redhat.com, lkp@01.org, David Rientjes , kirill@shutemov.name, Andrew Morton , zi.yan@cs.rutgers.edu, Vlastimil Babka Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Dec 3, 2018 at 2:04 PM Linus Torvalds wrote: > > so I think all of David's patch is somewhat sensible, even if that > specific "order == pageblock_order" test really looks like it might > want to be clarified. Side note: I think maybe people should just look at that whole compaction logic for that block, because it doesn't make much sense to me: /* * Checks for costly allocations with __GFP_NORETRY, which * includes THP page fault allocations */ if (costly_order && (gfp_mask & __GFP_NORETRY)) { /* * If compaction is deferred for high-order allocations, * it is because sync compaction recently failed. If * this is the case and the caller requested a THP * allocation, we do not want to heavily disrupt the * system, so we fail the allocation instead of entering * direct reclaim. */ if (compact_result == COMPACT_DEFERRED) goto nopage; /* * Looks like reclaim/compaction is worth trying, but * sync compaction could be very expensive, so keep * using async compaction. */ compact_priority = INIT_COMPACT_PRIORITY; } this is where David wants to add *his* odd test, and I think everybody looks at that added case + if (order == pageblock_order && + !(current->flags & PF_KTHREAD)) + goto nopage; and just goes "Eww". But I think the real problem is that it's the "goto nopage" thing that makes _sense_, and the current cases for "let's try compaction" that are the odd ones, and then David adds one new special case for the sensible behavior. For example, why would COMPACT_DEFERRED mean "don't bother", but not all the other reasons it didn't really make sense? So does it really make sense to fall through AT ALL to that "retry" case, when we explicitly already had (gfp_mask & __GFP_NORETRY)? Maybe the real fix is to instead of adding yet another special case for "goto nopage", it should just be unconditional: simply don't try to compact large-pages if __GFP_NORETRY was set. Hmm? I dunno. Right now - for 4.20, I'd obviously want to keep changes smallish, so a hacky added special case might be the right thing to do. But the code does look odd, doesn't it? I think part of it comes from the fact that we *used* to do the compaction first, and then we did the reclaim, and then it was re-orghanized to do reclaim first, but it tried to keep semantic changes minimal and some of the above comes from that re-org. I think. Linus