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 1D22FA00BE for ; Wed, 20 Apr 2022 17:47:55 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0FBC341104; Wed, 20 Apr 2022 17:47:55 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id 668B1406A2; Wed, 20 Apr 2022 17:47:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1650469672; x=1682005672; h=message-id:date:subject:to:cc:references:from: in-reply-to:content-transfer-encoding:mime-version; bh=2GWyPF0mw4rNcQkWTiZe2fjUNo1lqHGUVdd9UlXUC24=; b=FW5tuxgrVF7QRrv+Q47XrzuoylzBmaufD1vIfKt/qsiHVZFI/P4zwXkL bX15xiwLuIXLvUP8XHq0dv0n4/EroojphKoWhdb2eAya0fW2Q4WZXpt7h WO5u21yfOVNCnXqa7EoKGQ/CeAqG7g+hhoJPMUP7ennmviVG7Xhi2EGDP cElnb7qu9zrZdgF/W4eXbKNcRXIgE0hWcfeZZZ/QaAjKQT224Svs+aFxA k1b1zr5ei0OFtO8N2pxnMl9i7sWd5AvNYCKH2fSUVTdGMDh7R4K8GseHn uTVzN64JAEkJcQQtmEO3fUh4Rn82HreM76mLh48vdrAgPFowGONcSG8tc A==; X-IronPort-AV: E=McAfee;i="6400,9594,10323"; a="263824685" X-IronPort-AV: E=Sophos;i="5.90,276,1643702400"; d="scan'208";a="263824685" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Apr 2022 08:26:46 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,276,1643702400"; d="scan'208";a="668747692" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by orsmga004.jf.intel.com with ESMTP; 20 Apr 2022 08:26:45 -0700 Received: from fmsmsx607.amr.corp.intel.com (10.18.126.87) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Wed, 20 Apr 2022 08:26:45 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx607.amr.corp.intel.com (10.18.126.87) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Wed, 20 Apr 2022 08:26:44 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27 via Frontend Transport; Wed, 20 Apr 2022 08:26:44 -0700 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.43) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.27; Wed, 20 Apr 2022 08:26:44 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ONTKLPU/JGt08wfgGEiYKsKjvzRwwGZO7E4go7NfSTky8AkRhwBoPQfes7RSHtWUedeuM2oQFAIhsClduIK0bcDxPb3Eui8Z5XUkV6vkdUwNCNMk00wIchx1Pn7FEDQGGwOInJal2Wh+6uY9nen6WnSRlKiVhzPUYky8Yf1MyJx9zSStkuGz77n9QdCY+bDj8EwamP1u1xyXtxvP3fsfKf0wxj/1hT9eotGwu3mcYxKOlGk1lipw1GqHYcP1LkOOWJVD1qAG7OF9ZIAzK4WRv1U9e9JjzTWUCyIhMIoKz9uuUGSB5Y/wC1ME/JCIS1hI49kL64sVcwws/zTAfHPNkg== 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=r5UUj35Kt9U/Yn8plYBAqTb38qAYU9JMTpk0shl3SAk=; b=jgEc91qV4yoJ7oo+LheGpYomXmfuEWmvF3oPech7wCm7IXSOnlg2MO286802404wb+6B9IcphBaDSvIZaZcBrLaOXeu6M7UAocqQ8pnUW6E3WQCcE3hLaGwQeE+EarK62tiGS8voTXK/5kerIaQjwdvZXdzrZ/Z4OJZsxplCb5S0Jpnmt6I+z994z0UHiX/wa/3rcrJuGMsfysGzHn3dGb6QqnwmC+I7PM2PG3i0wQsOyubLCEsucZfNbpcsdEpJEG93F4YXcnH6G9KyWahrk0Iv8f4i/NtFbRFOZelseOkF2F5ABVgnwiTKvRFqVg/um5ggOaJg0SaAOhRjnuk/xg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; 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 CO1PR11MB5076.namprd11.prod.outlook.com (2603:10b6:303:90::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5164.20; Wed, 20 Apr 2022 15:26:43 +0000 Received: from PH0PR11MB5093.namprd11.prod.outlook.com ([fe80::28af:8ec5:1817:1af1]) by PH0PR11MB5093.namprd11.prod.outlook.com ([fe80::28af:8ec5:1817:1af1%3]) with mapi id 15.20.5164.025; Wed, 20 Apr 2022 15:26:43 +0000 Message-ID: <516eb0e3-e877-a69e-31c7-ab6487d49603@intel.com> Date: Wed, 20 Apr 2022 16:26:37 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0 Thunderbird/91.7.0 Subject: Re: [PATCH] eal/linux: skip attaching to external memory chunk Content-Language: en-US To: Deepak Khandelwal CC: , References: <1649075577-67300-1-git-send-email-deepak.khandelwal@intel.com> From: "Burakov, Anatoly" In-Reply-To: <1649075577-67300-1-git-send-email-deepak.khandelwal@intel.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO2P265CA0100.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:c::16) 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: 2c5d434e-1b55-457e-5385-08da22e22c48 X-MS-TrafficTypeDiagnostic: CO1PR11MB5076:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: U2bm6EfSsL4jqqFef1BLDDXX6Hn2XgbkJrzo+HZTvVSdIYt5NpLIg+YfGN2qZ4W7rH9+WLzGMoUVH8IPqMmg9UAyF6aWYyxq6vy2hwXRhgvI6lT0GMnrN7rC5MvbD+e4Khik89KoCJkx4jQd1/opzh8fNRsXo12sfF0Ae+LUcUPjmwCduFEjWmayjXAI8sAe2+6KcIWwikAMGCmgeKxbE7Il5j6crJEBM76J/KUe0exH8xhRz2CK7O9k0ZsSIstNta+mYYVWepmHhEib5F8zWM+5tQ3zvS7Q+8R7TTfqnnoSbySEwPPzNEeQXsZKEwUdc6BjmEPOfsIDJgqfxCAYl8kuuHOi6+Xt9oxSn8IJnIx3Ik842AhyXyPFxGe1Oao5WwtE2M0lplXbdLSX9ftJCnlM0seVf0IglXriybH1hYr2BwGQpF0TNoUQiI2iZx+0aGUYFbx1A2EeNfaPDnlzGwsn2nbSulxXf5iV3IatRVAd0z5WEmJAz6Ecu3f7GrZorey+PgajZ5eWf3ClWRWHcwrxwpzJrdeYotq0tP5rRLQA3tSx48qFismMJvdnFPgDSUYh1NgfptnpYggVyZeu7P8iC8+Cjs6xGhzxfL6jiLC68DyRvxjiIC4K/R3UVwKZ1yRg90niX5q4mbcTxPIraVhJZDAsphIfjXWakf6y+SrhG7hhwDJ8e5AXrwMk+lST1bda9Vjw+UUb+QbyMZRV6JQPOAGDUGrff3PESz5Ltkw11o9bYCfXhl+HJbKvyxocLZJGroHi2vs4EcEWMVeOm9oEg7lNYVEVVls7tQ5MIfIQ7aK0tDkudOahP9UhADIEZI1WJeJDlWTb/V2dbrb/fX1HquILQtUKV5mixdGkq0w= 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)(450100002)(6862004)(66476007)(86362001)(6512007)(38100700002)(82960400001)(6636002)(966005)(8676002)(2906002)(26005)(2616005)(37006003)(6506007)(8936002)(6666004)(6486002)(31696002)(53546011)(31686004)(66556008)(508600001)(36756003)(66946007)(186003)(83380400001)(316002)(4326008)(5660300002)(45980500001)(43740500002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?RzRFTnBkVWxLRzZ0c0xNODc5RTREY2xnZHVRb0tQNGxlcHpFL09PaTJDemNK?= =?utf-8?B?T05OcTdEMWJ4b2xxVnhyR1BvSm9VTmp0Ny9qWjEvcjlUYmZObDVZUFY3UHFY?= =?utf-8?B?bWY4YVhtblRSaGlkU3N4dzVxR3pwUndLMDgrcytuaHlrRjFva1hFUTAxVFpi?= =?utf-8?B?aklGZnFMTExnZ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f-8?B?Zk5ESTUrdGhkVDRUdFdOaG53QXdFa3NYeERndHA4ZnhxSGFQR09vQmd6YmRL?= =?utf-8?B?TjdiR3h4VlU5Q21jc05ZRks3ZkNhRXJYNlhWeUY3cm1jcWlKMUZZZjFWdUtj?= =?utf-8?B?NGpNRG81dUQ3cFU0RXRDczhsdkhIMm94UnV6L255cTZiREZoeDQzMW1Hakdr?= =?utf-8?B?WDVFbEh6WkFkVlJNYVZTNDlDUWxXdVk1TlZrbit2dUczMDdkYS9IMklxallN?= =?utf-8?B?UzNuS0Y5ZFU4N3ZlOWtRR1RFM1V5bmtRTTZiUFBiYVFoVmlnTDViUkgvN1dM?= =?utf-8?B?eEwzVVN0bC84dGFlTVNPQ21leHorMzBKRFVFSzdabkpCZjc2WGd1Y0RzbE43?= =?utf-8?Q?StZMTH9gg5nUHM/w=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 2c5d434e-1b55-457e-5385-08da22e22c48 X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5093.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Apr 2022 15:26:42.9736 (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: UWCaEcwrBflrVJ2rfdRt1CoLdlqjJAfnogW/OhI4QS7H9epaHLlaMET12XAARtO7lElfBWzrScNkToEoTYJaXaSbX+50d586KHIEn0HezWI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR11MB5076 X-OriginatorOrg: intel.com X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org On 04-Apr-22 1:32 PM, Deepak Khandelwal wrote: > when secondary process is initialized(rte_eal_init), > external memroy segments should not be attached. > These segments will be attached by explicitly invoking > rte_malloc_heap_memory_attach API > > Fixes: ff3619d6244b ("malloc: allow attaching to external memory chunks") > Cc: stable@dpdk.org > > Signed-off-by: Deepak Khandelwal > Suggested-by: Anatoly Burakov > --- > lib/eal/linux/eal_memory.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/lib/eal/linux/eal_memory.c b/lib/eal/linux/eal_memory.c > index ee1a9e6..18d2176 100644 > --- a/lib/eal/linux/eal_memory.c > +++ b/lib/eal/linux/eal_memory.c > @@ -1875,7 +1875,7 @@ void numa_error(char *where) > msl = &mcfg->memsegs[msl_idx]; > > /* skip empty memseg lists */ > - if (msl->memseg_arr.len == 0) > + if (msl->memseg_arr.len == 0 || msl->external) > continue; > > if (rte_fbarray_attach(&msl->memseg_arr)) { Suggested rewording of commit message: Currently, EAL init in secondary processes will attach all fbarrays in the memconfig to have access to primary process' page tables. However, fbarrays corresponding to external memory segments should not be attached at initialization, because this will happen as part of `rte_extmem_attach` or `rte_malloc_heap_memory_attach` calls. Acked-by: Anatoly Burakov Both external memory API's document this: rte_malloc: http://doc.dpdk.org/api/rte__malloc_8h.html#af6360dea35bdf162feeb2b62cf149fd3 rte_extmem: http://doc.dpdk.org/api/rte__memory_8h.html#a2796da68de6825f8edf53759f8e4d230 -- Thanks, Anatoly