From patchwork Fri Jul 19 10:42:52 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zhang, Xiong Y" X-Patchwork-Id: 2830443 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 883BFC0319 for ; Fri, 19 Jul 2013 10:40:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B164520374 for ; Fri, 19 Jul 2013 10:40:21 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 92E5820373 for ; Fri, 19 Jul 2013 10:40:20 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BD679E6F59 for ; Fri, 19 Jul 2013 03:40:20 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTP id 62DF8E6850 for ; Fri, 19 Jul 2013 03:39:37 -0700 (PDT) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP; 19 Jul 2013 03:39:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.89,700,1367996400"; d="scan'208";a="367844849" Received: from panda-dev.bj.intel.com ([10.238.154.175]) by fmsmga001.fm.intel.com with ESMTP; 19 Jul 2013 03:39:35 -0700 From: Xiong Zhang To: intel-gfx@lists.freedesktop.org Date: Fri, 19 Jul 2013 18:42:52 +0800 Message-Id: <1374230572-2983-2-git-send-email-xiong.y.zhang@intel.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1374230572-2983-1-git-send-email-xiong.y.zhang@intel.com> References: <1374230572-2983-1-git-send-email-xiong.y.zhang@intel.com> Subject: [Intel-gfx] [PATCH 2/2] tests: add reloc, pread, pwrite slow path subtest X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP the reloc, pread, pwrite slow path will be prevented by prefault, these subtests will disable prefault first, then do reloc, pread, pwrite, finally enable prefault. Signed-off-by: Xiong Zhang --- tests/gem_exec_faulting_reloc.c | 10 +++++++++- tests/gem_mmap_gtt.c | 15 +++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/tests/gem_exec_faulting_reloc.c b/tests/gem_exec_faulting_reloc.c index 863a1b0..c7f7b6b 100644 --- a/tests/gem_exec_faulting_reloc.c +++ b/tests/gem_exec_faulting_reloc.c @@ -220,7 +220,15 @@ static void run(int object_size) int main(int argc, char **argv) { - run(OBJECT_SIZE); + drmtest_subtest_init(argc, argv); + + if (drmtest_run_subtest("normal")) + run(OBJECT_SIZE); + if (drmtest_run_subtest("no-prefault")) { + drmtest_disable_prefault(); + run(OBJECT_SIZE); + drmtest_enable_prefault(); + } return 0; } diff --git a/tests/gem_mmap_gtt.c b/tests/gem_mmap_gtt.c index d759340..0e1b195 100644 --- a/tests/gem_mmap_gtt.c +++ b/tests/gem_mmap_gtt.c @@ -144,6 +144,15 @@ test_read(int fd) munmap(dst, OBJECT_SIZE); } +static void +run_without_prefault(int fd, + void (*func)(int fd)) +{ + drmtest_disable_prefault(); + func(fd); + drmtest_enable_prefault(); +} + int main(int argc, char **argv) { int fd; @@ -160,6 +169,12 @@ int main(int argc, char **argv) test_write(fd); if (drmtest_run_subtest("write-gtt")) test_write_gtt(fd); + if (drmtest_run_subtest("read-no-prefault")) + run_without_prefault(fd, test_read); + if (drmtest_run_subtest("write-no-prefault")) + run_without_prefault(fd, test_write); + if (drmtest_run_subtest("write-gtt-no-prefault")) + run_without_prefault(fd, test_write_gtt); close(fd);