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 018E7A0C45; Mon, 13 Sep 2021 15:15:14 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 775AC40151; Mon, 13 Sep 2021 15:15:14 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id D7D4A4014F; Mon, 13 Sep 2021 15:15:12 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10105"; a="307221886" X-IronPort-AV: E=Sophos;i="5.85,288,1624345200"; d="scan'208";a="307221886" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Sep 2021 06:15:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,288,1624345200"; d="scan'208";a="451568147" Received: from orsmsx605.amr.corp.intel.com ([10.22.229.18]) by orsmga002.jf.intel.com with ESMTP; 13 Sep 2021 06:15:10 -0700 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX605.amr.corp.intel.com (10.22.229.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Mon, 13 Sep 2021 06:15:10 -0700 Received: from orsmsx609.amr.corp.intel.com (10.22.229.22) by ORSMSX611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Mon, 13 Sep 2021 06:15:10 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) 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.2242.12 via Frontend Transport; Mon, 13 Sep 2021 06:15:10 -0700 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.177) 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.2242.12; Mon, 13 Sep 2021 06:15:09 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jXjORqky7Nn9YSo4QdV7gyLqhkbDpQ5Pvtw6knO2sylcNt5yvu1BnuqnTDA3q+0P86XTHBtgXVO0iceqIwQZnZww6U0bqOaNqP8xTZIePBy5w31KVpzQl/vfKWA7tGKT+so2HXXYoP1zr+VdIZlBUYRIFiViSTWYVRBJOOCxTtL+UhEEXpVWrx96MgsuybCbF3JAEGAQ1yzKRdX1KXFiGk0xEpUdDi7YgkH5C0gWpbxoZ9RG1GcB1PwO57+dmuQPXqbcQUypWBuOZvQnqMHvpFE710Of/YYXEG4ePlxBwQ1DBxbEyhSPaE+UhV3kZf62JjjjGb0Am9KAsSfcQEhymg== 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; bh=I+LDJDKa1PA++G5mzQHdZ1unXUAfZ+BHY7rVfbJ61DM=; b=R+n5PDxTpwX8TGl25f/msu33ML77KjEJjtHwI2h2sjZfptSE8HNubtBYVR/HE2dg34goSRp4dyIFq9loFwwLPxNd6YSTHNXX7lZl4AvZIKAMMoT+A8jIY6SRbRB+HCGjVY/TPc4+80AQKKFtr80aoVpAYKjpc4Gx6KVE0YEWu9/09V0Shnkx6rbC9EUSwuix/v4DD8DsHgfbfwMfyvrcqVzZ+SyOYt039RLbFfG4tf0MPFcKdt4NyGWNLZ2J2z6XWcVTX7DWX5cRH5vf5bxx69Crt/Wa6QmaLJR7CeMztwHeWm7ZyaVxmTSuHAh+P/M0Mmn5ZrSAQiaYWUmb9GMwCA== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=I+LDJDKa1PA++G5mzQHdZ1unXUAfZ+BHY7rVfbJ61DM=; b=mBp3PnYnx8ijohNmvHflkQFca22gYwl9BmrvEpsZo57R6jjO6LHFOf38WidIBuVasxK1cEcH0YdiaglHCMpxUQsa4Ry2qPd/LNv9U4DKK/K9nRpdusRUG37wIJWdOSY/tQVVaFfjszLWlir4278v3ljD3wSJnEB9F9jdxYA//e4= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=intel.com; Received: from PH0PR11MB5093.namprd11.prod.outlook.com (2603:10b6:510:3e::23) by PH0PR11MB5111.namprd11.prod.outlook.com (2603:10b6:510:3c::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.16; Mon, 13 Sep 2021 13:15:01 +0000 Received: from PH0PR11MB5093.namprd11.prod.outlook.com ([fe80::d145:710a:1bac:7e91]) by PH0PR11MB5093.namprd11.prod.outlook.com ([fe80::d145:710a:1bac:7e91%9]) with mapi id 15.20.4500.019; Mon, 13 Sep 2021 13:15:01 +0000 To: Bruce Richardson , CC: , References: <20210913110635.130387-1-bruce.richardson@intel.com> From: "Burakov, Anatoly" Message-ID: <48d75bc2-ae55-183c-8132-6e3e150647af@intel.com> Date: Mon, 13 Sep 2021 14:14:55 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0 Thunderbird/78.13.0 In-Reply-To: <20210913110635.130387-1-bruce.richardson@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-ClientProxiedBy: DB6PR07CA0179.eurprd07.prod.outlook.com (2603:10a6:6:43::33) To PH0PR11MB5093.namprd11.prod.outlook.com (2603:10b6:510:3e::23) MIME-Version: 1.0 Received: from [192.168.1.10] (212.17.34.161) by DB6PR07CA0179.eurprd07.prod.outlook.com (2603:10a6:6:43::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.9 via Frontend Transport; Mon, 13 Sep 2021 13:15:00 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c474ffff-b02e-419f-b5d2-08d976b87dec X-MS-TrafficTypeDiagnostic: PH0PR11MB5111: X-LD-Processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr X-MS-Exchange-Transport-Forked: True 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: jmPTaikXLRo9sOPmDrBCbcQ3+G19aS0kKOLfuc6/wezCEN6AGmTGEFcrioaSFwyKYjpV5Q/r92NoW8SplUAAGcHsBHlEpY7si/p7Zdiw1gXY1HXYieJ0af4erPpWx+aCEh5HLz1AAetO5k0oUuykh5GtBLrl2RmLb3IKo7J+ZzKvoZXceo5mLI+C+6V5ww5sFIi/gj7gZWzQdzIIshjV2GS4LGOVS7VKSyi3hSvIkYcSMgHD3P5L6V/p10SECE8yvYNBKeIT5kMlLeaA0l2cui4QX/xVr+DbO9BG0YsMLrrQxGrgAA8YmvI54itY/lDeNK1tPuGN+yUHZ5gGsbVUGuFwo8UCq3YSuL6y7DRBnaHqDDVqjdjTry064yZDWgwIXwOS2675FHcon4PRSSFURtLpWREmiqd+krLMzNfEBbRPDw6uL35vaLmA1hBj957c8nlLndjn74HwIaSrJHE11yRSq/+Jj636IoIGXZMi7y7+j4Kg7dpr8fP4qKrsIIVdERWQ5NnspAvhX6gaG2H8MZJtk2VZpcw6bkPz6CwAeftdohfoKKNekErozZ3UWGExLvmjDxT92CMY8J2IUUJLs8CT71S+2GI16HZpM2CpzSvpL1nm2sHmjssfahEU2+AnJPuTrJO7C9adjhSNdJ3tPATHcDVWWEx4tsSMOMPldf5GHLLPAmu3y6wec87n+dDp9DYqC3vljroUw8Vx2IvdRbRkyH+lJdxFb6XNvyiqo/c= 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:(4636009)(376002)(39860400002)(396003)(366004)(346002)(136003)(26005)(4326008)(316002)(16576012)(478600001)(6486002)(186003)(83380400001)(53546011)(31686004)(2906002)(66476007)(6666004)(66946007)(66556008)(5660300002)(8936002)(31696002)(38100700002)(8676002)(86362001)(36756003)(2616005)(956004)(45980500001)(43740500002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?OTRpYWZvZ0FkaFZTMzRyRjRkOFllcjRuVVRBMGFsYStXc2xuNG1wTlRQYkpk?= =?utf-8?B?TitJQW9yeGxMWlBBWERXZ2tuZFhmMFJLamdMVXJmWnMxbWhIbGJENWdKZ0pP?= =?utf-8?B?RVBYQ0NsUG8zTmw3dk0yWndhMEJCNGhYU2ZZTzBIcXBVcWNLYTR3anFPb2Q5?= =?utf-8?B?YVYwZmxOU05hajl4TVNPcmJxeU1RL3huOERaZXVDOVZlc2RUOWQ1VzcweGdr?= =?utf-8?B?bzRyTGFjdmdNZzVpbGJWRWx4WXZkMnRRdk9sSHhRL1dBVTBtZkJKNUpBS2hn?= =?utf-8?B?bklrRVhpenpOc0ZEZWxnZGtmTGhienkyZThRSW5rcUZRYVg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ZVY1OUMvVEFTUHBCaHRLOVBQ?= =?utf-8?B?RVhBZlZNRkhydWtwVjBtOGoySVF5RmNxaFVqY1RqOVdFWkovOWMvdnVFV25z?= =?utf-8?B?d1MxRjZNL0hxWE83UnRCbnlBczkrV1ZNNk9tS0pYY21HRVErRmxQVk1uRmQ5?= =?utf-8?B?OFo1UXlxSzZwbjZjZzdrdDlQQ1JQS0xiT3VleUREeG03ejFLaDVBSEVXY3RZ?= =?utf-8?B?WkJTMGZzL2txbmZkeTBzKytmL2s0ekc5cFF6anFML1Nrb3o2V0QrdE1nRzJi?= =?utf-8?B?bnJER1hHVG9jUjBQeTlzZklvbWlteFhQekhYTmhHNStvQXAwRUhvcElrSVBP?= =?utf-8?B?OEk1b0dLR1FXQWt5MTA3R29jdEN3WUg0UzRmcm1obUhsS29HNjI2NmJqRGJy?= =?utf-8?B?SmFIcExWRDhxaFluU3Z6WndJbENoRnA1Umt1SjFqRG1UY3NmK2MwWFVyU01H?= =?utf-8?B?R1kxTlluUzlQQWtHSVozdG9hOWNLdk5MYm5IbGVjMDdkUU81cEhEbkVzMTg1?= =?utf-8?Q?W/6syF4YuMhSai+lKx/g1iAj/PwMb3005ldAGZT?= X-MS-Exchange-CrossTenant-Network-Message-Id: c474ffff-b02e-419f-b5d2-08d976b87dec X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5093.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Sep 2021 13:15:00.9456 (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: 8DIHdv2t5A5yWGWkv42xm1fEb9e+rfaUkCptUXj9PYBvLT/JgWwQkb76YC8a+D2iheo1abe1SUlRrSkuBxMkhAY/LqI8uyq9xNZHfATYNIM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB5111 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH] eal/freebsd: lock memory device to prevent conflicts 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 Sender: "dev" On 13-Sep-21 12:06 PM, Bruce Richardson wrote: > Only a single DPDK process on the system can be using the /dev/contigmem > mappings at a time, but this was never explicitly enforced, e.g. when > using --in-memory flag on two processes. To prevent possible conflict > issues, we lock the dev node when it's in use, preventing other DPDK > processes from starting up and causing problems for us. > > Fixes: 764bf26873b9 ("add FreeBSD support") > Cc: stable@dpdk.org > > Signed-off-by: Bruce Richardson > --- > lib/eal/freebsd/eal_hugepage_info.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/lib/eal/freebsd/eal_hugepage_info.c b/lib/eal/freebsd/eal_hugepage_info.c > index 408f054f7a..4a8d87c23e 100644 > --- a/lib/eal/freebsd/eal_hugepage_info.c > +++ b/lib/eal/freebsd/eal_hugepage_info.c > @@ -90,6 +90,10 @@ eal_hugepage_info_init(void) > RTE_LOG(ERR, EAL, "could not open "CONTIGMEM_DEV"\n"); > return -1; > } > + if (flock(fd, LOCK_EX) < 0) { > + RTE_LOG(ERR, EAL, "could not lock memory. Is another DPDK process running?\n"); > + return -1; > + } > > if (buffer_size >= 1<<30) > RTE_LOG(INFO, EAL, "Contigmem driver has %d buffers, each of size %dGB\n", > This only gets triggered when regular init path is chosen, i.e. --no-huge still works. I'm a bit uneasy with --in-memory mode pretending to work on FreeBSD and Windows, but that's a separate problem :) As far as the patch goes, the problem it addresses does get fixed. Reviewed-by: Anatoly Burakov -- Thanks, Anatoly