Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp633635ybi; Fri, 31 May 2019 06:46:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqzjmlb1MH4JKV8yBehZP8eFj+ZViid+2pt2zSntTwAJgIsUyUiJXbPRD9e/2XxY5XDjxLpM X-Received: by 2002:a63:db47:: with SMTP id x7mr6083207pgi.259.1559310397669; Fri, 31 May 2019 06:46:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559310397; cv=none; d=google.com; s=arc-20160816; b=ZjJaXfn+n6x/kY4poDXOOl4vxZHoAmMEAQsrOtn46q7cilfh2P5rKYSO22AXLoS4q+ zZE62AeUAY32oONVANB8Yiklai6dSKBmhwwjpsn18O40PeiXBvGr9NEDzyMtnTUU8kHp n1ZRVKRDuvmqIY7zTKciMxGiRx2xykk11OrlWKWJM9u3aRnbDKggBAHDwLTrbBSgAo+i O6aWrnS1b3lm1C+cFdjKHMUXjMcfz/nohAZmjtaYu4qBRQ94MccShCNe513vuLjrwrYB sKdiPh4goOf3LSZ2wRRfwMbEPZoTN4kVH+I9pr5DbQiBky2tLKai2pLFr1tVZFHVKZtT Xp6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=vPbIIJuyYstqKudbEw2Wc+jcaMTMVd97T1l4e8lD3KA=; b=04xO9OLmyN4oM/DiniBv00PyYp8m6j8NVKnwKif9MnQPhfHhuSvMeSDxBwN9jGjpWB kyEf2/HCPSLjYz2kKEaYs5QVjlaxxegMCJJpgOC3MniPS2UE5iB8qhDTPRYw2nvmn73u Kixo9XxLQAlYh0TlVXYMxQr7Oo/YiX9oQ57F/z+v+r4Dth4GBLiTdf+8LkcVxmh3IANT 2dzKbxmTr1fTZWtRbDbijVtnu2QM9wF69/P5i2xIW28kQgq/3Gzn14gqM1wd+a/e1LQH fXVwk8Zw3EBHaQmvBNebIkJZkZbOKYggr0ja88QzkgBmxdr7fc0n5Io7XU5IvXScuMht dx3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=ZEX8PNbz; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i123si7753233pfc.60.2019.05.31.06.46.17; Fri, 31 May 2019 06:46:37 -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=fail header.i=@gmail.com header.s=20161025 header.b=ZEX8PNbz; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726715AbfEaNo6 (ORCPT + 99 others); Fri, 31 May 2019 09:44:58 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:44290 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726418AbfEaNo5 (ORCPT ); Fri, 31 May 2019 09:44:57 -0400 Received: by mail-pf1-f193.google.com with SMTP id x3so730632pff.11; Fri, 31 May 2019 06:44:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=vPbIIJuyYstqKudbEw2Wc+jcaMTMVd97T1l4e8lD3KA=; b=ZEX8PNbz0qOV4voBBdbFmKU8Z61+Kq1IWhx5JPVytMYOvYTBT5KAWMYHlQHpuKdgSg HSrAx8xuwmobu/aN7G69ZUXBZGFsZAZKV9Jwh7R86aeFbLWpR61w1dIFZRGmCJEQeIJX cWE9s+nnWFabfC6BKmM5q+lzvE9zelYV4BIrEjFfbqCw6jo4BlTEpDpeVU9ZNlUskaZE QxrQ3Kle9nm1Vhb7WtfmtLmGs/xkMXVJASxfRSvUPhsmiQFlY+5ygS1PjZUquJEC4CoC ODl+QIaQ/YQt/Fyrhd0r1FX06SAFd8tvZi3XzPE6c2gDd+30+cy7tWw0Q6OCeGgjV+/u 6ZGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=vPbIIJuyYstqKudbEw2Wc+jcaMTMVd97T1l4e8lD3KA=; b=KxTOSLjed++fvl4TmCnNEQrSR4rjgkhG4/v6y7aei4wwWwfqfm0MAkoHnfMxC6WXzL 0ZEErW5BPuJRFi51DQiFJR/te/6kO9E3ZMnPeS5WJxMCHcpPIJREyGiFZf33zlFO4Pza uBKacJUlRKzHeA5ZG41TfUwigAtB8y3lTldzObn4MmanwAsn2+dAM1ZGJEs/hYsTHkXo VsZz+Fm3svKlvGoEehfLgKonBoS07/F4h7AVadIXGVuRKNUqZ8N8dnf164ZsDBgIGPO9 QkancrHb3Tl3lHQK4a6jEij4tqDSLzEoFHNtsG745gW2NvRMgY1S88p/N6B0yhDkl7LE SaZg== X-Gm-Message-State: APjAAAXiRNPUJQFv1owGRKapet5F2D7ViJtOZ/g4kpcPP+hNuK/iUc6Z STkxCm1+AWx80iw+Zbjxf/0= X-Received: by 2002:a17:90a:9382:: with SMTP id q2mr9524146pjo.131.1559310296875; Fri, 31 May 2019 06:44:56 -0700 (PDT) Received: from google.com ([122.38.223.241]) by smtp.gmail.com with ESMTPSA id g83sm6546532pfb.158.2019.05.31.06.44.50 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 31 May 2019 06:44:55 -0700 (PDT) Date: Fri, 31 May 2019 22:44:47 +0900 From: Minchan Kim To: Michal Hocko Cc: Andrew Morton , linux-mm , LKML , linux-api@vger.kernel.org, Johannes Weiner , Tim Murray , Joel Fernandes , Suren Baghdasaryan , Daniel Colascione , Shakeel Butt , Sonny Rao , Brian Geffon , jannh@google.com, oleg@redhat.com, christian@brauner.io, oleksandr@redhat.com, hdanton@sina.com Subject: Re: [RFCv2 3/6] mm: introduce MADV_PAGEOUT Message-ID: <20190531134447.GD195463@google.com> References: <20190531064313.193437-1-minchan@kernel.org> <20190531064313.193437-4-minchan@kernel.org> <20190531085044.GJ6896@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190531085044.GJ6896@dhcp22.suse.cz> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 31, 2019 at 10:50:44AM +0200, Michal Hocko wrote: > On Fri 31-05-19 15:43:10, Minchan Kim wrote: > > When a process expects no accesses to a certain memory range > > for a long time, it could hint kernel that the pages can be > > reclaimed instantly but data should be preserved for future use. > > This could reduce workingset eviction so it ends up increasing > > performance. > > > > This patch introduces the new MADV_PAGEOUT hint to madvise(2) > > syscall. MADV_PAGEOUT can be used by a process to mark a memory > > range as not expected to be used for a long time so that kernel > > reclaims the memory instantly. The hint can help kernel in deciding > > which pages to evict proactively. > > Again, are there any restictions on what kind of memory can be paged out? > Private/Shared, anonymous/file backed. Any restrictions on mapping type. > Etc. Please make sure all that is in the changelog. It's same with MADV_COLD. Yes, I will include all detail in the description. > > What are the failure modes? E.g. what if the swap is full, does the call > fails or it silently ignores the error? In such case, just ignore the swapout. It returns -EINVAL only if the vma is one of (VM_LOCKED|VM_HUGETLB|VM_PFNMAP) at this moment. > > Thanks! > -- > Michal Hocko > SUSE Labs