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=-2.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_DKIMWL_WL_HIGH, USER_AGENT_MUTT autolearn=unavailable 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 61DBFC46470 for ; Fri, 31 May 2019 08:50:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2E1602479C for ; Fri, 31 May 2019 08:50:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559292649; bh=H0YCCBLkpQqYTU6X2HPTeAEMFw+WsFm9xFJghDfbqg0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=ramHkrLFYf69DXMTzkbu3mpLhigmylnFYXvDbjL5V1AUYaA4y5GSnvPfS4vFlicVC Q9yK/wQpcPYIJjGoxeccIBCT5tbk2BYfn7rVOb39hsdw1Yv53arBHCPdpJdm/6mB38 9UD17gUzJfalzJVes1wdPkRy4vpUOyvlAy+E5mc0= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727006AbfEaIus (ORCPT ); Fri, 31 May 2019 04:50:48 -0400 Received: from mx2.suse.de ([195.135.220.15]:56026 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726158AbfEaIur (ORCPT ); Fri, 31 May 2019 04:50:47 -0400 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 2BDD5AF55; Fri, 31 May 2019 08:50:46 +0000 (UTC) Date: Fri, 31 May 2019 10:50:44 +0200 From: Michal Hocko To: Minchan Kim 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: <20190531085044.GJ6896@dhcp22.suse.cz> References: <20190531064313.193437-1-minchan@kernel.org> <20190531064313.193437-4-minchan@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190531064313.193437-4-minchan@kernel.org> 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 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. What are the failure modes? E.g. what if the swap is full, does the call fails or it silently ignores the error? Thanks! -- Michal Hocko SUSE Labs