From patchwork Mon May 14 09:26:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li Wang X-Patchwork-Id: 912793 X-Patchwork-Delegate: petr.vorel@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.linux.it (client-ip=213.254.12.146; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from picard.linux.it (picard.linux.it [213.254.12.146]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40kwLx69xHz9ryk for ; Mon, 14 May 2018 19:26:49 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 320BD3E75D0 for ; Mon, 14 May 2018 11:26:47 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-3.smtp.seeweb.it (in-3.smtp.seeweb.it [217.194.8.3]) by picard.linux.it (Postfix) with ESMTP id 064183E602A for ; Mon, 14 May 2018 11:26:45 +0200 (CEST) Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by in-3.smtp.seeweb.it (Postfix) with ESMTPS id 58FE31A01179 for ; Mon, 14 May 2018 11:26:42 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id ABAAF8D68B for ; Mon, 14 May 2018 09:26:40 +0000 (UTC) Received: from dhcp-12-102.nay.redhat.com (unknown [10.66.12.102]) by smtp.corp.redhat.com (Postfix) with ESMTP id C802D1102E30 for ; Mon, 14 May 2018 09:26:39 +0000 (UTC) From: Li Wang To: ltp@lists.linux.it Date: Mon, 14 May 2018 17:26:34 +0800 Message-Id: <20180514092635.26100-1-liwang@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Mon, 14 May 2018 09:26:40 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Mon, 14 May 2018 09:26:40 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'liwang@redhat.com' RCPT:'' X-Virus-Scanned: clamav-milter 0.99.2 at in-3.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=-0.0 required=7.0 tests=SPF_HELO_PASS,SPF_PASS autolearn=disabled version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on in-3.smtp.seeweb.it Subject: [LTP] [PATCH 1/2] madvise: add MADV_WIPEONFORK/MADV_KEEPONFORK in madvise() test X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.18 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" The kernel commit (d2cd9ed mm,fork: introduce MADV_WIPEONFORK) introduces two new advices for madvise() in kernel-v4.14. Here making LTP cover that test accordingly. Signed-off-by: Li Wang --- include/lapi/mmap.h | 5 +++++ testcases/kernel/syscalls/madvise/madvise01.c | 3 +++ 2 files changed, 8 insertions(+) diff --git a/include/lapi/mmap.h b/include/lapi/mmap.h index 7a55800..18547c0 100644 --- a/include/lapi/mmap.h +++ b/include/lapi/mmap.h @@ -71,6 +71,11 @@ # define MADV_FREE 8 #endif +#ifndef MADV_WIPEONFORK +# define MADV_WIPEONFORK 18 +# define MADV_KEEPONFORK 19 +#endif + #ifdef HAVE_SYS_SHM_H # include # define MMAP_GRANULARITY SHMLBA diff --git a/testcases/kernel/syscalls/madvise/madvise01.c b/testcases/kernel/syscalls/madvise/madvise01.c index 4b18a21..8d1d787 100644 --- a/testcases/kernel/syscalls/madvise/madvise01.c +++ b/testcases/kernel/syscalls/madvise/madvise01.c @@ -62,6 +62,9 @@ static struct tcase { {MADV_DONTDUMP, "MADV_DONTDUMP", &sfile}, /* since Linux 3.4 */ {MADV_DODUMP, "MADV_DODUMP", &sfile}, /* since Linux 3.4 */ {MADV_FREE, "MADV_FREE", &amem}, /* since Linux 4.5 */ + {MADV_WIPEONFORK, "MADV_WIPEONFORK", &amem}, /* since Linux 4.14 */ + {MADV_KEEPONFORK, "MADV_KEEPONFORK", &amem}, /* since Linux 4.14 */ + }; static void setup(void)