get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/105908/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 105908,
    "url": "http://patchwork.dpdk.org/api/patches/105908/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20220117080801.481568-5-dkozlyuk@nvidia.com/",
    "project": {
        "id": 1,
        "url": "http://patchwork.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<20220117080801.481568-5-dkozlyuk@nvidia.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20220117080801.481568-5-dkozlyuk@nvidia.com",
    "date": "2022-01-17T08:07:59",
    "name": "[v1,4/6] eal: refactor --huge-unlink storage",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "387684a182689d93a164cceea1ac9628cbf491f9",
    "submitter": {
        "id": 2248,
        "url": "http://patchwork.dpdk.org/api/people/2248/?format=api",
        "name": "Dmitry Kozlyuk",
        "email": "dkozlyuk@nvidia.com"
    },
    "delegate": {
        "id": 24651,
        "url": "http://patchwork.dpdk.org/api/users/24651/?format=api",
        "username": "dmarchand",
        "first_name": "David",
        "last_name": "Marchand",
        "email": "david.marchand@redhat.com"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20220117080801.481568-5-dkozlyuk@nvidia.com/mbox/",
    "series": [
        {
            "id": 21199,
            "url": "http://patchwork.dpdk.org/api/series/21199/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=21199",
            "date": "2022-01-17T08:07:55",
            "name": "Fast restart with many hugepages",
            "version": 1,
            "mbox": "http://patchwork.dpdk.org/series/21199/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/105908/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/105908/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 18322A034F;\n\tMon, 17 Jan 2022 09:08:51 +0100 (CET)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id C06BB4120A;\n\tMon, 17 Jan 2022 09:08:31 +0100 (CET)",
            "from NAM10-MW2-obe.outbound.protection.outlook.com\n (mail-mw2nam10on2085.outbound.protection.outlook.com [40.107.94.85])\n by mails.dpdk.org (Postfix) with ESMTP id 4AA3B411C9\n for <dev@dpdk.org>; Mon, 17 Jan 2022 09:08:28 +0100 (CET)",
            "from DM5PR08CA0027.namprd08.prod.outlook.com (2603:10b6:4:60::16) by\n BN9PR12MB5131.namprd12.prod.outlook.com (2603:10b6:408:118::19) with\n Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4888.10; Mon, 17 Jan\n 2022 08:08:26 +0000",
            "from DM6NAM11FT049.eop-nam11.prod.protection.outlook.com\n (2603:10b6:4:60:cafe::7c) by DM5PR08CA0027.outlook.office365.com\n (2603:10b6:4:60::16) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4888.11 via Frontend\n Transport; Mon, 17 Jan 2022 08:08:26 +0000",
            "from mail.nvidia.com (12.22.5.235) by\n DM6NAM11FT049.mail.protection.outlook.com (10.13.172.188) with Microsoft SMTP\n Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id\n 15.20.4888.9 via Frontend Transport; Mon, 17 Jan 2022 08:08:25 +0000",
            "from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL107.nvidia.com\n (10.27.9.16) with Microsoft SMTP Server (TLS) id 15.0.1497.18;\n Mon, 17 Jan 2022 08:08:25 +0000",
            "from nvidia.com (10.126.231.35) by rnnvmail201.nvidia.com\n (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.986.9; Mon, 17 Jan 2022\n 00:08:23 -0800"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;\n b=C2/W6zZ9CG8kdXHclircZqqtrB9RRjJzvW9I5fjb5gNQdgEemXCi0MiiVlcnIFM3ZkAa7zag/YRBAwKg/I/UJZSHinrIz7Q3kZejXMe2X5if3BKXrQA4KwnmzBRPPKui9kpUP0J0kj3Fsh3UKcCz5gjjGj3dSgvnFNgoKnJqwLacUpsGGr4aTEwXgiTeOyWbfKh+waKAsaYKcVDOPcRgNi7HN1rhQzGP64tVq5KwvMlwG3ZklMTev9NwNm317i4fC21pTcoSIbN9J9duSgUGQvngw4z0sHR+mrvnq1aJkofIeZ6vRY2XUJ9ShDIf5AFl4WwqX3NtRd3UCT3/IfC7Rg==",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;\n s=arcselector9901;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;\n bh=MotN3DXJjnc90k7ER7XOP0TEwbKuHQSsDOkUzmyIzf0=;\n b=eKdGK5olzIDKSM/PqpJey3DFvZp2/2mYgtrSFfpXFBvm9ua5Ki4VFrh+qNI73UfpUceBSA1QmQ957xWC8IWuHapNW690KFbfFhTAbcrRtOR7iV5mWLcZIzC0ztVwqOuo1lkeAjFoLWzI60J5EhYWjDdiQL8fCrxLCpIqcDsW77AiZixvZP/VXZV7wSyD86xmtzTzBoFwD+PtWk752m4qGWlO6494x2QBW9QB1a3Ly3EOakgPMNJAFrKC4JuUnX9AK9NvoApUOqbUTn5wzTRZW6ZURE0yHuMIzO7vnje76PMDxvCuJSyjfbMrY5qoHJAHDde4prGyo2PKFXkko2yYVw==",
        "ARC-Authentication-Results": "i=1; mx.microsoft.com 1; spf=pass (sender ip is\n 12.22.5.235) smtp.rcpttodomain=intel.com smtp.mailfrom=nvidia.com; dmarc=pass\n (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none\n (message not signed); arc=none",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com;\n s=selector2;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n bh=MotN3DXJjnc90k7ER7XOP0TEwbKuHQSsDOkUzmyIzf0=;\n b=QHGuYC3r5Nq1rYq4bdgITXEWVyo02+kAhDswimKvUI0J6lyZwjSjBcMeqG2wwhP3hXuPe12W+zc80K+KKOzjz7Co70Fbxkz1svJm7cWO/juSaClBrkm0m5DbovZHBSroe9s8V/iTr0yTTj+3RmA3Fd6J7E5Js7lpLAq56Xt97AOOhQmx9HWp62ljfzYbTetFvR/OhdgwarmMnmlGfT7NeFjPt/RRzAZfERggBtHV84eyoZDlrmpHvu+lkUYYmAce/gLg1N3c+4jqnP0iU6OnW7vgSFLiemvLjk69nXdetrQO1+1taEsYV0jWytoD2GtnI4hAGhgzlFwQS07dX7n2fQ==",
        "X-MS-Exchange-Authentication-Results": "spf=pass (sender IP is 12.22.5.235)\n smtp.mailfrom=nvidia.com; dkim=none (message not signed)\n header.d=none;dmarc=pass action=none header.from=nvidia.com;",
        "Received-SPF": "Pass (protection.outlook.com: domain of nvidia.com designates\n 12.22.5.235 as permitted sender) receiver=protection.outlook.com;\n client-ip=12.22.5.235; helo=mail.nvidia.com;",
        "From": "Dmitry Kozlyuk <dkozlyuk@nvidia.com>",
        "To": "<dev@dpdk.org>",
        "CC": "Anatoly Burakov <anatoly.burakov@intel.com>",
        "Subject": "[PATCH v1 4/6] eal: refactor --huge-unlink storage",
        "Date": "Mon, 17 Jan 2022 10:07:59 +0200",
        "Message-ID": "<20220117080801.481568-5-dkozlyuk@nvidia.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20220117080801.481568-1-dkozlyuk@nvidia.com>",
        "References": "<20211230143744.3550098-1-dkozlyuk@nvidia.com>\n <20220117080801.481568-1-dkozlyuk@nvidia.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Originating-IP": "[10.126.231.35]",
        "X-ClientProxiedBy": "HQMAIL105.nvidia.com (172.20.187.12) To\n rnnvmail201.nvidia.com (10.129.68.8)",
        "X-EOPAttributedMessage": "0",
        "X-MS-PublicTrafficType": "Email",
        "X-MS-Office365-Filtering-Correlation-Id": "655d8d69-4add-43f6-dfaf-08d9d99089c4",
        "X-MS-TrafficTypeDiagnostic": "BN9PR12MB5131:EE_",
        "X-Microsoft-Antispam-PRVS": "\n <BN9PR12MB5131D1FCBE8FC338158D081FB9579@BN9PR12MB5131.namprd12.prod.outlook.com>",
        "X-MS-Oob-TLC-OOBClassifiers": "OLM:1850;",
        "X-MS-Exchange-SenderADCheck": "1",
        "X-MS-Exchange-AntiSpam-Relay": "0",
        "X-Microsoft-Antispam": "BCL:0;",
        "X-Microsoft-Antispam-Message-Info": "\n n4pRxhwinC8eBVeQrLOodd4epmk585Stqxm1vpWT+KA+L6oLFAxOgr3vOFGFFohF1vMbLWlfx7dh67Hnczv10C4uwbgfXT9avaN0XeakQAp9GuIag29CmhyI+2GwQwiEtnGZtteumVT0QL6yy++T4+Lnr9g92+aUfQ0as4GB/JnGVtmHov7C/wViCVALfkG6HYYXhkjptlhcVEJg1JqMdo1x7JcmHtxSRK11yBXfb4HF9Ah8FCX8wX9/bWg3BZfU8T0cOsHjTFpoWRqI3E8pMs4TwPdf3HvVDoGO++L5xD9Iv1jjN9PYU9cyVke5wnB+vCBiKPilPIsbokVWuhnCUkk68fdA1RiWjUrx8goilImi8Z2yazlW+tjKipWlOqbda89Txy38XJZlWHxpjKTNYGtUNJ5Vi8q5FLRRSILEf3nzpV6wnnn4mpm6MImbmEtrXugr8s4wFw1mE2kHayFKRYIZw5QTGPQ4zgqHKcYy6+eXMsXNtAfWqwwNB778pS/zCCfnBmj8UI/qpUkSYgnt85FIPixtFjg/mQBj9jMyyWhXuQh8rnoQlik2uAGXuLcA9+tzuB0xXxw5yTc3pzkFz7C4jm5lmAn0N8GDXQjqORJOOF8XwYFq0bGvGPFtjp5xiVVr9KVdwF4HP03DySanU0wm5rCDV24kwFSw964QmsnqwLtNUTQlRllDkaCKM8pCEDpdc+5NGOWQA1gqMp0UbyULFzqSCb74IU7FFeaZ0pxWIBHZxOc1oVX7Fxe4JfS1XrvWlCtILdYTrEoMeQrAJmtRb4SkNVpn1+F9EqdJuTWbPwRGNh/RRDeRmeHsPuOYjOH56N6yD34Oo/qx6OCP8w==",
        "X-Forefront-Antispam-Report": "CIP:12.22.5.235; CTRY:US; LANG:en; SCL:1; SRV:;\n IPV:CAL; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE;\n SFS:(4636009)(46966006)(36840700001)(40470700002)(47076005)(70586007)(6666004)(81166007)(6916009)(2906002)(83380400001)(186003)(82310400004)(356005)(7696005)(508600001)(5660300002)(40460700001)(70206006)(8676002)(16526019)(55016003)(316002)(8936002)(4326008)(36756003)(26005)(2616005)(1076003)(6286002)(426003)(336012)(86362001)(36860700001)(14583001)(36900700001);\n DIR:OUT; SFP:1101;",
        "X-OriginatorOrg": "Nvidia.com",
        "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "17 Jan 2022 08:08:25.8284 (UTC)",
        "X-MS-Exchange-CrossTenant-Network-Message-Id": "\n 655d8d69-4add-43f6-dfaf-08d9d99089c4",
        "X-MS-Exchange-CrossTenant-Id": "43083d15-7273-40c1-b7db-39efd9ccc17a",
        "X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp": "\n TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[12.22.5.235];\n Helo=[mail.nvidia.com]",
        "X-MS-Exchange-CrossTenant-AuthSource": "\n DM6NAM11FT049.eop-nam11.prod.protection.outlook.com",
        "X-MS-Exchange-CrossTenant-AuthAs": "Anonymous",
        "X-MS-Exchange-CrossTenant-FromEntityHeader": "HybridOnPrem",
        "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "BN9PR12MB5131",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org"
    },
    "content": "In preparation to extend --huge-unlink option semantics\nrefactor how it is stored in the internal configuration.\nIt makes future changes more isolated.\n\nSigned-off-by: Dmitry Kozlyuk <dkozlyuk@nvidia.com>\n---\n lib/eal/common/eal_common_options.c | 9 +++++----\n lib/eal/common/eal_internal_cfg.h   | 8 +++++++-\n lib/eal/linux/eal_memalloc.c        | 7 ++++---\n lib/eal/linux/eal_memory.c          | 2 +-\n 4 files changed, 17 insertions(+), 9 deletions(-)",
    "diff": "diff --git a/lib/eal/common/eal_common_options.c b/lib/eal/common/eal_common_options.c\nindex 1cfdd75f3b..7520ebda8e 100644\n--- a/lib/eal/common/eal_common_options.c\n+++ b/lib/eal/common/eal_common_options.c\n@@ -1737,7 +1737,7 @@ eal_parse_common_option(int opt, const char *optarg,\n \n \t/* long options */\n \tcase OPT_HUGE_UNLINK_NUM:\n-\t\tconf->hugepage_unlink = 1;\n+\t\tconf->hugepage_file.unlink_before_mapping = true;\n \t\tbreak;\n \n \tcase OPT_NO_HUGE_NUM:\n@@ -1766,7 +1766,7 @@ eal_parse_common_option(int opt, const char *optarg,\n \t\tconf->in_memory = 1;\n \t\t/* in-memory is a superset of noshconf and huge-unlink */\n \t\tconf->no_shconf = 1;\n-\t\tconf->hugepage_unlink = 1;\n+\t\tconf->hugepage_file.unlink_before_mapping = true;\n \t\tbreak;\n \n \tcase OPT_PROC_TYPE_NUM:\n@@ -2050,7 +2050,8 @@ eal_check_common_options(struct internal_config *internal_cfg)\n \t\t\t\"be specified together with --\"OPT_NO_HUGE\"\\n\");\n \t\treturn -1;\n \t}\n-\tif (internal_cfg->no_hugetlbfs && internal_cfg->hugepage_unlink &&\n+\tif (internal_cfg->no_hugetlbfs &&\n+\t\t\tinternal_cfg->hugepage_file.unlink_before_mapping &&\n \t\t\t!internal_cfg->in_memory) {\n \t\tRTE_LOG(ERR, EAL, \"Option --\"OPT_HUGE_UNLINK\" cannot \"\n \t\t\t\"be specified together with --\"OPT_NO_HUGE\"\\n\");\n@@ -2061,7 +2062,7 @@ eal_check_common_options(struct internal_config *internal_cfg)\n \t\t\t\" is only supported in non-legacy memory mode\\n\");\n \t}\n \tif (internal_cfg->single_file_segments &&\n-\t\t\tinternal_cfg->hugepage_unlink &&\n+\t\t\tinternal_cfg->hugepage_file.unlink_before_mapping &&\n \t\t\t!internal_cfg->in_memory) {\n \t\tRTE_LOG(ERR, EAL, \"Option --\"OPT_SINGLE_FILE_SEGMENTS\" is \"\n \t\t\t\"not compatible with --\"OPT_HUGE_UNLINK\"\\n\");\ndiff --git a/lib/eal/common/eal_internal_cfg.h b/lib/eal/common/eal_internal_cfg.h\nindex d6c0470eb8..b5e6942578 100644\n--- a/lib/eal/common/eal_internal_cfg.h\n+++ b/lib/eal/common/eal_internal_cfg.h\n@@ -40,6 +40,12 @@ struct simd_bitwidth {\n \tuint16_t bitwidth; /**< bitwidth value */\n };\n \n+/** Hugepage backing files discipline. */\n+struct hugepage_file_discipline {\n+\t/** Unlink files before mapping them to leave no trace in hugetlbfs. */\n+\tbool unlink_before_mapping;\n+};\n+\n /**\n  * internal configuration\n  */\n@@ -48,7 +54,7 @@ struct internal_config {\n \tvolatile unsigned force_nchannel; /**< force number of channels */\n \tvolatile unsigned force_nrank;    /**< force number of ranks */\n \tvolatile unsigned no_hugetlbfs;   /**< true to disable hugetlbfs */\n-\tunsigned hugepage_unlink;         /**< true to unlink backing files */\n+\tstruct hugepage_file_discipline hugepage_file;\n \tvolatile unsigned no_pci;         /**< true to disable PCI */\n \tvolatile unsigned no_hpet;        /**< true to disable HPET */\n \tvolatile unsigned vmware_tsc_map; /**< true to use VMware TSC mapping\ndiff --git a/lib/eal/linux/eal_memalloc.c b/lib/eal/linux/eal_memalloc.c\nindex 337f2bc739..abbe605e49 100644\n--- a/lib/eal/linux/eal_memalloc.c\n+++ b/lib/eal/linux/eal_memalloc.c\n@@ -564,7 +564,7 @@ alloc_seg(struct rte_memseg *ms, void *addr, int socket_id,\n \t\t\t\t\t__func__, strerror(errno));\n \t\t\t\tgoto resized;\n \t\t\t}\n-\t\t\tif (internal_conf->hugepage_unlink &&\n+\t\t\tif (internal_conf->hugepage_file.unlink_before_mapping &&\n \t\t\t\t\t!internal_conf->in_memory) {\n \t\t\t\tif (unlink(path)) {\n \t\t\t\t\tRTE_LOG(DEBUG, EAL, \"%s(): unlink() failed: %s\\n\",\n@@ -697,7 +697,7 @@ alloc_seg(struct rte_memseg *ms, void *addr, int socket_id,\n \t\t\tclose_hugefile(fd, path, list_idx);\n \t} else {\n \t\t/* only remove file if we can take out a write lock */\n-\t\tif (internal_conf->hugepage_unlink == 0 &&\n+\t\tif (!internal_conf->hugepage_file.unlink_before_mapping &&\n \t\t\t\tinternal_conf->in_memory == 0 &&\n \t\t\t\tlock(fd, LOCK_EX) == 1)\n \t\t\tunlink(path);\n@@ -756,7 +756,8 @@ free_seg(struct rte_memseg *ms, struct hugepage_info *hi,\n \t\t/* if we're able to take out a write lock, we're the last one\n \t\t * holding onto this page.\n \t\t */\n-\t\tif (!internal_conf->in_memory && !internal_conf->hugepage_unlink) {\n+\t\tif (!internal_conf->in_memory &&\n+\t\t\t\tinternal_conf->hugepage_file.unlink_before_mapping) {\n \t\t\tret = lock(fd, LOCK_EX);\n \t\t\tif (ret >= 0) {\n \t\t\t\t/* no one else is using this page */\ndiff --git a/lib/eal/linux/eal_memory.c b/lib/eal/linux/eal_memory.c\nindex 03a4f2dd2d..83eec078a4 100644\n--- a/lib/eal/linux/eal_memory.c\n+++ b/lib/eal/linux/eal_memory.c\n@@ -1428,7 +1428,7 @@ eal_legacy_hugepage_init(void)\n \t}\n \n \t/* free the hugepage backing files */\n-\tif (internal_conf->hugepage_unlink &&\n+\tif (internal_conf->hugepage_file.unlink_before_mapping &&\n \t\tunlink_hugepage_files(tmp_hp, internal_conf->num_hugepage_sizes) < 0) {\n \t\tRTE_LOG(ERR, EAL, \"Unlinking hugepage files failed!\\n\");\n \t\tgoto fail;\n",
    "prefixes": [
        "v1",
        "4/6"
    ]
}