From patchwork Tue Dec 11 14:29:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vlastimil Babka X-Patchwork-Id: 10723903 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A014991E for ; Tue, 11 Dec 2018 14:30:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 90C8E2B191 for ; Tue, 11 Dec 2018 14:30:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 84C0F2B1AB; Tue, 11 Dec 2018 14:30:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 21FEE2B1A8 for ; Tue, 11 Dec 2018 14:30:13 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5729C8E004D; Tue, 11 Dec 2018 09:30:10 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 4DDAB8E0095; Tue, 11 Dec 2018 09:30:10 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3581D8E0098; Tue, 11 Dec 2018 09:30:10 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) by kanga.kvack.org (Postfix) with ESMTP id C77FE8E0094 for ; Tue, 11 Dec 2018 09:30:09 -0500 (EST) Received: by mail-ed1-f69.google.com with SMTP id v4so6852724edm.18 for ; Tue, 11 Dec 2018 06:30:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id:mime-version:content-transfer-encoding; bh=AurLN4jigbxWmyq+O8ohh7vbhDUr0CgtDp2C3AxHwXk=; b=V6pxXalojR9Aed3IaON4OcwBX11Qu1QizrZJzpvm+N6NJn+tdVXl9gqB/itpmUXLv0 lG9KOqKSh5IVsjNJS2nJ4oOlhUUvBga9xySdSsKne/bwPJTE7buF8FHURJWSVLdD/oYh X7eQwH9r4kt8+FJmEVx+x1wo9wjKHlHqUlzrarDfpF8f7WaHBgtUUgb/aaIhLfRJB1e5 RyFnd1vMaAxm+XaJ/f/uj/VDTn3+ZDtDVfrAC0hZ34sbugPDdPJ25hRIlAxipr0Kw0GC NQ5pKEBSA/zInMAPdQwYAL+H2Nf7iL1iqq+qVQBfGBrCSxXqHQE/7Ofe3SCL/RFtEy+o A3Iw== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of vbabka@suse.cz designates 195.135.220.15 as permitted sender) smtp.mailfrom=vbabka@suse.cz X-Gm-Message-State: AA+aEWY/Z8jrYPkxeAOr2jCa98c+S4dVir653Ru1dJ3iWmUXfMlhQYYX xRFJSmCYxaXsGUgVLMzhbBGQZB4EUK7dPBi/4u71R4x5H67KxS7Ur/gxX1dIxshOOqK7bbEsncr txubi6U8WM4KBUcZhmC1RIefC2MqphKUzQEuj0d28PAuq2Bgl8fYL8C/xiauqznYVZg== X-Received: by 2002:a50:a938:: with SMTP id l53mr15028853edc.194.1544538609344; Tue, 11 Dec 2018 06:30:09 -0800 (PST) X-Google-Smtp-Source: AFSGD/XaphZ0jpnbob/qMIgIipLyGxopP/nXxirf1tsd6YZ/Iqr3MV1eaz4ChhZc6pZGyiuobJPG X-Received: by 2002:a50:a938:: with SMTP id l53mr15028805edc.194.1544538608334; Tue, 11 Dec 2018 06:30:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544538608; cv=none; d=google.com; s=arc-20160816; b=nlE1I9T9SKrOqMrE/ETTCi1I2YVBBbAowAziimDn9lYfmU8+rh5Oiuy58tv68BWxch iKOCbtILwRCPa9thnp2ZWICd3ohva7dV5VebAXoMY9I4M0MkuLSn5rAtaP2+DQaPgA3v WqyEwb4x2IdU0ifmT/KfzjQgQKzhNiCoy4gCWeSzm5rXfW+KmbBU4zrUyCoGQyYIWuOu 2DDBP9zWTFlTUOcFNniKFC5q3CxQZ52Bwpp0URnRKnzKQPpdpYXXRhOLgURWNhkQNaSg AtBOsBRSzksXLuuMsNY7pz89OHHLxzcmxiTltdPLGmMQj52TvsWoTXTKGI5/p5owXyhO CMdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from; bh=AurLN4jigbxWmyq+O8ohh7vbhDUr0CgtDp2C3AxHwXk=; b=SZ1+OML52dHZNyGLIanQVRinhRB+szys+m2KNp6A15iDkdJ1GBO+d7c06pXfgi8gFR 1oxrbRdzfcdS4Xquyfu0gMJKA8fiMHWz2SCyV0TkR5wPB32LZY8YoMJLJjKCNV4cnplh JH66ygBDclUwhKdUpAdvo49dVXMFvlHFMHdlTJSWtOYSsM/0AwN4FUJsIW1Q33+NbDPC vCgCKJTJes/ST62lMC/ktdMyldj1E0E1G6r3jGW0uyWYdwEdWEsfpKSG1gPHoBwCcaUL 00z/ogicgTfzu3sj6awd1j1CyWorHvQuJ+VdTIhLboo+h6Rc5GY4j+hU5rX2+jU730PF XaTQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of vbabka@suse.cz designates 195.135.220.15 as permitted sender) smtp.mailfrom=vbabka@suse.cz Received: from mx1.suse.de (mx2.suse.de. [195.135.220.15]) by mx.google.com with ESMTPS id o5si713567edj.260.2018.12.11.06.30.08 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Dec 2018 06:30:08 -0800 (PST) Received-SPF: pass (google.com: domain of vbabka@suse.cz designates 195.135.220.15 as permitted sender) client-ip=195.135.220.15; Authentication-Results: mx.google.com; spf=pass (google.com: domain of vbabka@suse.cz designates 195.135.220.15 as permitted sender) smtp.mailfrom=vbabka@suse.cz X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id B5A7AB036; Tue, 11 Dec 2018 14:30:07 +0000 (UTC) From: Vlastimil Babka To: David Rientjes , Andrea Arcangeli , Mel Gorman Cc: Michal Hocko , Linus Torvalds , linux-mm@kvack.org, Andrew Morton , Vlastimil Babka Subject: [RFC 0/3] reduce THP fault thrashing Date: Tue, 11 Dec 2018 15:29:38 +0100 Message-Id: <20181211142941.20500-1-vbabka@suse.cz> X-Mailer: git-send-email 2.19.2 MIME-Version: 1.0 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: X-Virus-Scanned: ClamAV using ClamSMTP Hi, this is my attempt at reducing the madvised THP fault local node thrashing by reclaim+compaction attempts which Andrea reported, by trying to better utilize recent compaction results. It doesn't introduce any new __GFP_ONLY_COMPACT flag or add order-specific decisions like Andrea's and David's previous patches, but it does add __GFP_NORETRY back to madvised THP faults, like they both did (Patch 1). Patch 2 is based on another Andrea's suggestion, where any compaction failure is a reason to not try further (not just defered compaction). Finally, patch 3 introduces defered compaction tracking for async mode which is what's used for THP faults. Details in respective patch changelogs. I haven't tested it yet besides running transhuge-stress and verifying via tracepoints that defered async compaction does happen. I hope all interested parties can test the series on their workloads, thanks in advance. I expect that THP fault success rates will be worse, but hopefully it will also fix the local node thrashing issue. The success rates can then likely be improved by making compaction core smarter, but that's a separate topic. The series is based on v4.20-rc6. Vlastimil Vlastimil Babka (3): mm, thp: restore __GFP_NORETRY for madvised thp fault allocations mm, page_alloc: reclaim for __GFP_NORETRY costly requests only when compaction was skipped mm, compaction: introduce deferred async compaction include/linux/compaction.h | 10 ++-- include/linux/mmzone.h | 6 +-- include/trace/events/compaction.h | 29 ++++++----- mm/compaction.c | 80 ++++++++++++++++++------------- mm/huge_memory.c | 13 +++-- mm/page_alloc.c | 14 +++--- 6 files changed, 84 insertions(+), 68 deletions(-)