Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1417193imm; Wed, 10 Oct 2018 14:20:32 -0700 (PDT) X-Google-Smtp-Source: ACcGV60wr/bbofN32B/QM4YhJgxBeTWjhR0RwUwQL2DHy+P1poC3jXnH7EmaSZ4lvbYNXXcCk6td X-Received: by 2002:a63:f409:: with SMTP id g9-v6mr29381315pgi.369.1539206432870; Wed, 10 Oct 2018 14:20:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539206432; cv=none; d=google.com; s=arc-20160816; b=icADnb3LSVjf9H1Lqxx6/qcXjU9HW2MF1A8UziQ71CepRO5A23slBZm9lFLoppjH0u npe1FSNl5fdAB/jriKZTtOAY8CGjQyX5mYwi575OUMehqVmDLjj3f/DfF2yNM5Kgvmuk H3KwvBO79MLGz9PfrK2rzrOl3yawq/y4pvcPUm9nOZtyGcL6bcAXT+9yGMygygqwAXCp WMvL98+2alQsk7wM3tLdttO4JaPH4Druw5gyFh1YF4FQQHgkwxtyY/0hX3byHAPG/PFR Ov3HDV/DBKala8UkU0SwsTRNxTwWiDlmJKa+bRu/ZwGW80JfDx9bvoesM4WMkG8tlkKu Pt5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date:dkim-signature; bh=yykrxpRV78qYBMeciCEpmSX4PlMFziSN3/u/DsL14co=; b=sUSDKvqzAaqM9ycSPuHkm1Jt9tBjuk3OMwxFs3aT6pPPYHzrGAlvxZ8rkT/GQPEMz9 LkaFi/gT3aD7g4ImB1tTZhzGqRypEiRKkYjdioTsES+KCPQ3eQbP8MEdMscTHodbCiUC KFQGRj8EqlrniBkuuXhzB+gzQsPMkp0GZfIhX7zBnAX2U/laRl67T7M1jyOQxPHmb+08 3jZf613l2aWr11zJPSZSYzLheURvni+kSQKraBa43q/Utynf+6mfkuaH2Agor3CgX5XE STHDgREdHy3saOFbt7Xs/qUVv9Gzvzjjudu7SMUaTP6FmFVQ2rnAtm73kvs+RjozmFew HTMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=rE2KReM8; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z9-v6si25218181pgh.213.2018.10.10.14.20.16; Wed, 10 Oct 2018 14:20:32 -0700 (PDT) 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=@google.com header.s=20161025 header.b=rE2KReM8; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726016AbeJKEnZ (ORCPT + 99 others); Thu, 11 Oct 2018 00:43:25 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:46003 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725908AbeJKEnZ (ORCPT ); Thu, 11 Oct 2018 00:43:25 -0400 Received: by mail-pf1-f196.google.com with SMTP id u12-v6so3234194pfn.12 for ; Wed, 10 Oct 2018 14:19:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=yykrxpRV78qYBMeciCEpmSX4PlMFziSN3/u/DsL14co=; b=rE2KReM8SKUmjyZ5+iZ8QevgmS68Nu9hgs7Xfhq8ajnE5v6wX34L176CXOfWMjcad6 2nuo2FxQAMG1ke3ZXJWW0c+79jMnN4TRWsQtD/NcDyOO78Ekj8vp7yaE2qT/iS7hrfSn N8f9w8JP9bVQ+lWS9dyyMb8jcTfklE2KDdoUIYGx3ssQEuBPZ+4Zwceif/hbSXdnQA7z Rc3zlijkY2kPVxBiSg8uyjTCSEd4DtCLd1ImUiUGe8q+7YFbopWlsKeyLCs4v5SGWhSI JLSt+DH5td1ycoEEPcfsjMOx/H0T3VXX3QOs2Lpogc66mETuDaMhTviFrkIo6N8hAj4f Z+8A== 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:in-reply-to:message-id :references:user-agent:mime-version; bh=yykrxpRV78qYBMeciCEpmSX4PlMFziSN3/u/DsL14co=; b=e6DXOf9OL2HpxKvvT6sRks3WDBbtrlk4C6a2amNlo8lCK6o8dDTiviXXxjEaEhI2br n+9PeYTqxuHVGBOFnuLZGAr5YZzIwG/ef6shk0buDOd/irtL9DcToPswVWo7thPZWhC/ 6OZxF8l9qQi2kWcGR3uhpBrrPWF1mYCLM1iMH1hnpn70A0yTCM/O72e1dqkykEyPgRfM 5IC4KQUwGCG0ggrKUux1wjWcFQveLO9HFCQ8G8AzEbpLUl9S7p+a9oJjKyp1V+2b4/yV bqUibBgf0EUIvKBWCPMdkiHZkTzpfyFrBm0qcJTMSaKAIkImTOuRLM7SOjdw/GCA8FZ+ t6Fw== X-Gm-Message-State: ABuFfoh6885yhTLOi4Tp7CP5dNNAjeLh3CkR3pKzQ0pe53/sLaciYU4m ympOblRDViQ/OKrWEGoJqz5Hiw== X-Received: by 2002:a62:939d:: with SMTP id r29-v6mr36555578pfk.55.1539206365920; Wed, 10 Oct 2018 14:19:25 -0700 (PDT) Received: from [2620:15c:17:3:3a5:23a7:5e32:4598] ([2620:15c:17:3:3a5:23a7:5e32:4598]) by smtp.gmail.com with ESMTPSA id b62-v6sm36621902pfa.159.2018.10.10.14.19.24 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 10 Oct 2018 14:19:25 -0700 (PDT) Date: Wed, 10 Oct 2018 14:19:24 -0700 (PDT) From: David Rientjes X-X-Sender: rientjes@chino.kir.corp.google.com To: Andrea Arcangeli cc: Michal Hocko , Mel Gorman , Andrew Morton , Vlastimil Babka , Andrea Argangeli , Zi Yan , Stefan Priebe - Profihost AG , "Kirill A. Shutemov" , linux-mm@kvack.org, LKML , Stable tree Subject: Re: [PATCH 1/2] mm: thp: relax __GFP_THISNODE for MADV_HUGEPAGE mappings In-Reply-To: <20181009230352.GE9307@redhat.com> Message-ID: References: <20180925120326.24392-2-mhocko@kernel.org> <20181005073854.GB6931@suse.de> <20181005232155.GA2298@redhat.com> <20181009094825.GC6931@suse.de> <20181009122745.GN8528@dhcp22.suse.cz> <20181009130034.GD6931@suse.de> <20181009142510.GU8528@dhcp22.suse.cz> <20181009230352.GE9307@redhat.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 9 Oct 2018, Andrea Arcangeli wrote: > I think "madvise vs mbind" is more an issue of "no-permission vs > permission" required. And if the processes ends up swapping out all > other process with their memory already allocated in the node, I think > some permission is correct to be required, in which case an mbind > looks a better fit. MPOL_PREFERRED also looks a first candidate for > investigation as it's already not black and white and allows spillover > and may already do the right thing in fact if set on top of > MADV_HUGEPAGE. > We would never want to thrash the local node for hugepages because there is no guarantee that any swapping is useful. On COMPACT_SKIPPED due to low memory, we have very clear evidence that pageblocks are already sufficiently fragmented by unmovable pages such that compaction itself, even with abundant free memory, fails to free an entire pageblock due to the allocator's preference to fragment pageblocks of fallback migratetypes over returning remote free memory. As I've stated, we do not want to reclaim pointlessly when compaction is unable to access the freed memory or there is no guarantee it can free an entire pageblock. Doing so allows thrashing of the local node, or remote nodes if __GFP_THISNODE is removed, and the hugepage still cannot be allocated. If this proposed mbind() that requires permissions is geared to me as the user, I'm afraid the details of what leads to the thrashing are not well understood because I certainly would never use this.