Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp3476604pxb; Sun, 26 Sep 2021 16:47:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw28AiaL3ZowFo7Fyfjcurfk1dpkMxZkGSuHm4bXkRxF90GTiXnpYXWzVrTWcuyuzqng4u0 X-Received: by 2002:a50:9347:: with SMTP id n7mr19653813eda.249.1632700040518; Sun, 26 Sep 2021 16:47:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632700040; cv=none; d=google.com; s=arc-20160816; b=otGYMOU/fVIiJscMLtzt1fbAyHkkRWMZkkIMUukEZpVAEB/hIQdYKB8Kf3r5AwfT/l 0/UDq5rL6jG+y6ZZk4l/ZHOTFNHKA1ppwLWO5vcXv2GPggHFRP4MvpGrYMtN9f5jEmSE 6gotm5dPW+kCU0npkZb7pkOXegm2uBLDwRhZYmgsGqw+9SUiERdNoK+pbOtdCbdUX6jI zOzM32Di5ygG4TQoLHYgJIni3QSSGiiCuowGuIM71cT7YMFvvwS1+rUf3rkM5kQ/jjSG idzZSxg2TLJs910ugvV7GLMe330IIkz+mZb65dLKVncMAkHXjuRBHF+H7r1zHrxvPD9i 9t4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=8K0wNqs/UoQMVWcbLzg7zpAq9uT/7eob5sdcWrFFCjE=; b=IBzyCBZjAnA2CEM9ljmXEd6MCo6fnp3A22eAHAFcpi0/RT2NxZY6VlWzCiqbuXWIt2 lbYlN5cstEfHq6gP0Pw6YcgdYE+iGdj+2R1a/6gDVmTJJYlMfqLUpbth5x3Lsdtb1N3F KgQS3kEtPQyXf9YBaTe5sAHBiRy1HcoVojc5lnxCebf6NarIjaFlyzX3BfhLkUTUGBaq gWZG+2sHHhqJzC0ZxhwfI16/mUlmcBjyJdi+TC8ZbLATgjQ3kAQos5nP7dTA/QBq4NO+ Z+HpvONlKlalc5g0y1/wReTZMWjbl32m7VMmjG2LVEfM3RzrMITw7IB1vUKa7RvdCP0W sckQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="kFD/Z5J2"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a1si15744518edx.506.2021.09.26.16.46.57; Sun, 26 Sep 2021 16:47:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="kFD/Z5J2"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232501AbhIZXpy (ORCPT + 99 others); Sun, 26 Sep 2021 19:45:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56652 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232377AbhIZXpn (ORCPT ); Sun, 26 Sep 2021 19:45:43 -0400 Received: from mail-pf1-x432.google.com (mail-pf1-x432.google.com [IPv6:2607:f8b0:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B533C06176E for ; Sun, 26 Sep 2021 16:44:05 -0700 (PDT) Received: by mail-pf1-x432.google.com with SMTP id k26so9543072pfi.5 for ; Sun, 26 Sep 2021 16:44:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8K0wNqs/UoQMVWcbLzg7zpAq9uT/7eob5sdcWrFFCjE=; b=kFD/Z5J2xj2ugTXgq4UIoOmypwygBjvLHOo6K1Tc2eigh5LmmXmw4Zso7FtsJioTot NCveaxdSuE0wWDPtgXUB105caBHoki1Ykx3c6yGx1jzhRfbO6iVmun2NDokYZuBown1b jrDg1MmxL3N3x8JfVYUi5c5Bn9vT7lxFTM0DMbhZtblAQGV73y2w/ClWXvz/ykQVfJ/3 rp8weZtfpGoRSnQOOH2wRKK3bliUnB8OUuU/rYZR5mwQyzNYblNCGOLbyOlq1gl9Q6hB ApCFinCHC7VktDousGIAl5ap9EPULJ2GijlEFQ6okPzKb+v3evU1HXqnoQiYwu9pZqzA wLlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=8K0wNqs/UoQMVWcbLzg7zpAq9uT/7eob5sdcWrFFCjE=; b=3gPplkMFfDbFqOYgLpiTOHuUBKZTZwdUK9Knjg49YBultMfZGdd+uJ3/zS3HzUvg6u SVSbk7RK7fs5+aQg9I7VccCZMswXC/5k7EGWtL4CoexmioLKoynCn4+O5Jjr0/5ugNlh ls523VfptPFc1J6inf4WxoZAP9ZiSt0h4D1H/60lZ7ivrA+U0bIpoXg+nSwIUCUgg18J KSm6ddaa7GewZawc6JuN02KxYZWBCk4ymp1QlBgSrbajg+pj7DokbxS1L7M2c6hl8/zL vaIjOwRshYM7hvS2ZNqv4MAj4J3kg0s5ncYoBy1P7gJ3yQuzZG0tZZaMBfKWhlBbmq0/ YNbw== X-Gm-Message-State: AOAM533R0YoRLrADcskL0F1pL/5pKPM/JI6bjFQ70f+X56jA1BFxorgH 2LjKMA0YqjCZ82qlVqWh4Pk= X-Received: by 2002:a65:6a4b:: with SMTP id o11mr13448662pgu.278.1632699844886; Sun, 26 Sep 2021 16:44:04 -0700 (PDT) Received: from sc2-haas01-esx0118.eng.vmware.com ([66.170.99.1]) by smtp.gmail.com with ESMTPSA id n22sm16783686pgc.55.2021.09.26.16.44.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Sep 2021 16:44:04 -0700 (PDT) From: Nadav Amit X-Google-Original-From: Nadav Amit To: Andrew Morton Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Peter Xu , Nadav Amit , Andrea Arcangeli , Minchan Kim , Colin Cross , Suren Baghdasarya , Mike Rapoport Subject: [RFC PATCH 8/8] mm/madvise: process_madvise(MADV_DONTNEED) Date: Sun, 26 Sep 2021 09:12:59 -0700 Message-Id: <20210926161259.238054-9-namit@vmware.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210926161259.238054-1-namit@vmware.com> References: <20210926161259.238054-1-namit@vmware.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nadav Amit Userfaultfd users, for the sake of memory management, debugging or other types of monitoring may wish to use process_madvise(MADV_DONTNEED). Moreover, since process_madvise() supports vectored operations, and now supports efficient TLB flushes, existing users of madvise(MADV_DONTNEED) that wish to perform advices on non-contiguous memory may prefer the vectored process_madvise() flavor for performance reasons. Cc: Andrea Arcangeli Cc: Andrew Morton Cc: Minchan Kim Cc: Colin Cross Cc: Suren Baghdasarya Cc: Mike Rapoport Signed-off-by: Nadav Amit --- mm/madvise.c | 1 + 1 file changed, 1 insertion(+) diff --git a/mm/madvise.c b/mm/madvise.c index 9528c38fb6a4..d8f70960680e 100644 --- a/mm/madvise.c +++ b/mm/madvise.c @@ -81,6 +81,7 @@ static const struct madvise_info madvise_info[MADV_SOFT_OFFLINE+1] = { }, [MADV_DONTNEED] = { .behavior_valid = 1, + .process_behavior_valid = 1, .need_mmap_read_only = 1, .tlb_batching = 1, }, -- 2.25.1