From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6637AA0350; Tue, 8 Feb 2022 16:29:09 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E541D410FD; Tue, 8 Feb 2022 16:29:08 +0100 (CET) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id 8C2B0410FC for ; Tue, 8 Feb 2022 16:29:06 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644334146; x=1675870146; h=message-id:date:subject:to:cc:references:from: in-reply-to:content-transfer-encoding:mime-version; bh=+omRQaVRWN/5oAfyea+XqUo3WmLXqErIiLItigSFZZk=; b=i0dN3JPtO0X5Oca+6V9GvCTfNFRz6z9dJgTPqEer2C67lXZnBdSikcKm dnT48pd/Aqh+nuJzgtY7LyNqzXNCmBuu53cEj1/9onwTlHGsglqcjyeSV qt7SubarSJ5cpTSLdkJUQgX/V18M6Cx83mHA4l1++bDgMXxH4xE+9gVhY /bN304/VM/H8yobi+OgH9bqdA0kKYrtsV8Zb3H4sx0IfkTvqWZX3eDLWs HYb4ROYbhI21grIWNX2tIE3CUHzUvF9NOEYb+RfOOrx4tDQh3MJ12ruu5 VXV9mgo9ao1kL6hmcKLv+IsOm8+n8HlEukRC1hiq+LAA3caqtxpnm4pV4 A==; X-IronPort-AV: E=McAfee;i="6200,9189,10252"; a="228938363" X-IronPort-AV: E=Sophos;i="5.88,353,1635231600"; d="scan'208";a="228938363" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2022 07:29:05 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,353,1635231600"; d="scan'208";a="632872111" Received: from orsmsx606.amr.corp.intel.com ([10.22.229.19]) by orsmga004.jf.intel.com with ESMTP; 08 Feb 2022 07:29:05 -0800 Received: from orsmsx609.amr.corp.intel.com (10.22.229.22) by ORSMSX606.amr.corp.intel.com (10.22.229.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Tue, 8 Feb 2022 07:29:04 -0800 Received: from orsmsx604.amr.corp.intel.com (10.22.229.17) by ORSMSX609.amr.corp.intel.com (10.22.229.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Tue, 8 Feb 2022 07:29:04 -0800 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx604.amr.corp.intel.com (10.22.229.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20 via Frontend Transport; Tue, 8 Feb 2022 07:29:04 -0800 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.172) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.20; Tue, 8 Feb 2022 07:29:04 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JNOsXZ/zjqiod6VWefI1wprugOZ7EkZRqU1ERrWiqvLp3JMzyAFh7cEMGTOyiPHVLmnj0Jet3gB81ctBfAoAECM1UgrsHKLt8TbFZU4vN/MF3BGly0foClmAyr1UqZDrZtlc8VMDnNVKZ4nlsEuilbv3VeizI3LJYErpZ0TKQrzSzM7vs7wSGWgk+LEmON1D0jebIWoyfIRQhZB4KDKeLGGfGoDVa76KariiFVz6nocJnrTd0xNXQS8mRiBQ282aZLd5exT+H775G0R0/8JzKFRtY/0i6fv7hJ9K5RXG1dD35xevAKvvr96+ZxrHiRgvgESAv+zfyXX+ekDSEe7TAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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; bh=by3YrLTciLyjj5Q+CNXWqupB1I4kU76ruA6AYxe3wd8=; b=bTYgOpuxpU198MSwWFWeWLjPEL+FfiW/9aUXF/49RqH8tWblUbKjBKwT7AsJ0aO5zRkFek6Lq+Tzdy93rNxR9gSFK49GA+c4DHpHklGiO2POQvu6WWyLsUSfuxJpP/fXSAOjQa/KbVK5GFnZ1zq1l69Jsruvcyd4g6I2os+zf44/jPFDdytNQgWalolrJLqQGdnWSck/xfCD8DGg9vSJS5QPedqziYRHPH2RwGv8RVCKT5Z0EdekpFL/UKKJTeNC/W098441/wfd9gPUeSyXqAhbm5e4lgjX6Mhr3OrtvSqB2sJGJ/aIaT8P+L4nLIccvv7k7+Nn7HNuJ86v2uPKDw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from PH0PR11MB5093.namprd11.prod.outlook.com (2603:10b6:510:3e::23) by CY4PR11MB1351.namprd11.prod.outlook.com (2603:10b6:903:26::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.18; Tue, 8 Feb 2022 15:29:00 +0000 Received: from PH0PR11MB5093.namprd11.prod.outlook.com ([fe80::ad52:b9b6:8147:b4d5]) by PH0PR11MB5093.namprd11.prod.outlook.com ([fe80::ad52:b9b6:8147:b4d5%4]) with mapi id 15.20.4951.019; Tue, 8 Feb 2022 15:29:00 +0000 Message-ID: Date: Tue, 8 Feb 2022 15:28:52 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0 Thunderbird/91.5.1 Subject: Re: [PATCH v3 1/6] doc: add hugepage mapping details Content-Language: en-US To: Dmitry Kozlyuk , CC: Bruce Richardson References: <20220119210917.765505-1-dkozlyuk@nvidia.com> <20220203181337.759161-1-dkozlyuk@nvidia.com> <20220203181337.759161-2-dkozlyuk@nvidia.com> From: "Burakov, Anatoly" In-Reply-To: <20220203181337.759161-2-dkozlyuk@nvidia.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO2P265CA0373.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a3::25) To PH0PR11MB5093.namprd11.prod.outlook.com (2603:10b6:510:3e::23) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5fef5235-a125-483f-3507-08d9eb17baaf X-MS-TrafficTypeDiagnostic: CY4PR11MB1351:EE_ X-LD-Processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: A0DuyAqfR9JDs9Uv1IU4ynCS7R70p7Xegt0sYqxhTbknjH+K9lQZeuFy0sEmDOh1k0B9Fv3U6ou905vpi8mE3ECFG3Eayufc9nNeTc+dJf7A/05tvx0LOvx8bAVqdFSUvAQcIOQRZNSYux+Iapy23Rz3NfmPrCJ4z3uD9Mm+jzGQ6+h+sBUqHzhnZ6YCUE8DdYrvpGACDB9Ie9q78PV0CvZ5K9l+09CI/q0z0yNojhd+f8Ey07AniVt6QRCYAKB8BVU6oV9S/P1FUnXWHAG3uCPbABU+tz6yFrytEQ6ES1iL8kzqsP/OZZorIIJwVU4M8FjAHKqT1KiqXPK5aH0Fb0Pob2aumewWpRSitKRE7lvKzMO46YJ7AeC3kJsA8k1zdGBzgy6KTtv/ffden7hFCrmB/2egR0gSKkQrB5O5A/hx+72WiPsuq8Fnqtc9pCMOX2mhZ9gjLUmd+b+v56GibAzHqCCs64ykSfP0UuyDmtGIWy7DyEAMUrsXtP5nE5A5+0cLvwJw26G4BMHJ3+edyg+1aZYvTGSe82+AYG7zf6sRfVPj8Oi1JRaLpGr3fCR76ChGmHPlVjZAF6pXky0KfF7Ieb98q8hfv0gZgLQLu+Oz1FliGXboi1VhcpdlWO/o1OIbvKW+PT9wuLvKy0M95NACmQDxOXGrOlN0isiNTV49gh2bUI8E4cj6GYvduSKi1Wn53eqvx5knmkcXyQBcCFtHKNGbnltwLm5YvrEli5I= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR11MB5093.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(83380400001)(4326008)(2906002)(86362001)(316002)(53546011)(186003)(26005)(6512007)(6506007)(31696002)(82960400001)(6666004)(6486002)(107886003)(2616005)(8676002)(38100700002)(8936002)(66476007)(66556008)(508600001)(36756003)(31686004)(66946007)(5660300002)(43740500002)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?WThGbkR6eFVSOHg1anlHeTIyYkJOZnFtZnlIMWpmeEpOSEl0dmZxZGRNYy8x?= =?utf-8?B?SGhRTmo0bmo1QkJoQjByNzNmaGFld3hmR2NYNlRFVnB5T2FkK3ZLcE5TOEgr?= =?utf-8?B?cnRmbUxMdUhvaForYXEraUFvMTBneU9BQ2JyL3Qxa25aWE9xWk52cjRTR0s3?= =?utf-8?B?bmU3N1ZsWWgxUUFZQXo4enNhSG1UcjBFZ3hrMys4MDc4amZvaDM3Z3NyRzlm?= =?utf-8?B?NkZmL3R1UStOMU5hQk9IWUhy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?B?Zis0cU5ySVV2dm1idFd6TXg5ald5UWt6dVNhUVh4ZXNmU2c5Z0RYcHFka1Fy?= =?utf-8?B?bGZVdjV3T2ZUUFRSWEZCWkRPZHk4cW1QZzNJb3BoOGtmMEpPemlRQWk4RXB3?= =?utf-8?B?Z1NvQmUxNzVid3NjOHE2WnhsV3YyQ1ZNQ1QxTEp0L3BBVDBWYjUzRThjOFl1?= =?utf-8?B?cU40amU1Y2tqZ3BxQjdBd0Jmek5BPT0=?= X-MS-Exchange-CrossTenant-Network-Message-Id: 5fef5235-a125-483f-3507-08d9eb17baaf X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5093.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Feb 2022 15:29:00.2361 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 0drXdsX5sEY0B6F0Lfl5PdTF1cROeO3gM1ssTW+EHG30GA/gXV2cXUt+F7qYTIv3QzmgZh/YvKehXv5y5tPnZL+w/+bG2d0zN8REdXr7+GA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR11MB1351 X-OriginatorOrg: intel.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On 03-Feb-22 6:13 PM, Dmitry Kozlyuk wrote: > Hugepage mapping is a layer of EAL malloc builds upon. > There were implicit references to its details, > like mentions of segment file descriptors, > but no explicit description of its modes and operation. > Add an overview of mechanics used on ech supported OS. > Convert memory management subsections from list items > to level 4 headers: they are big and important enough. > > Signed-off-by: Dmitry Kozlyuk > Acked-by: Bruce Richardson > --- > +In dynamic memory mode, EAL removes a backing hugepage file > +when all pages mapped from it are freed back to the system. > +However, backing files may persist after the application terminates > +in case of a crash or a leak of DPDK memory (e.g. ``rte_free()`` is missing). > +This reduces the number of hugepages available to other processes > +as reported by ``/sys/kernel/mm/hugepages/hugepages-*/free_hugepages``. > +EAL can remove the backing files after opening them for mapping > +if ``--huge-unlink`` is given to avoid polluting hugetlbfs. > +However, since it disables multi-process anyway, > +using anonymous mapping (``--in-memory``) is recommended instead. > + > +:ref:`EAL memory allocator ` relies on hugepages being zero-filled. > +Hugepages are cleared by the kernel when a file in hugetlbfs or its part > +is mapped for the first time system-wide > +to prevent data leaks from previous users of the same hugepage. > +EAL ensures this behavior by removing existing backing files at startup > +and by recreating them before opening for mapping (as a precaution). > + > +Anonymous mapping does not allow multi-process architecture. > +This mode does not use hugetlbfs > +and thus does not require root permissions for memory management > +(the limit of locked memory amount, ``MEMLOCK``, still applies). > +It is free of filename conflict and leftover file issues. > +If memfd_create(2) is supported both at build and run time, Nitpick, quote memfd? e.g. `memfd_create(2)` Otherwise, Acked-by: Anatoly Burakov -- Thanks, Anatoly