From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM04-SN1-obe.outbound.protection.outlook.com (mail-eopbgr700074.outbound.protection.outlook.com [40.107.70.74]) by dpdk.org (Postfix) with ESMTP id AF5732C0C for ; Fri, 24 Aug 2018 06:39:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=YgE/3kC36Q/dKxhrG/r1MUE4b0sS0LmBQBquTd9Z1BE=; b=K67LEJeQz231utD3rLIw3K2OSRXL45w/iBV47r4yc7cJA4zHQCmwQ16hLt8kX8v+6rD5+DCUdHeEw758Ow+/91LR0Nm9FoDKzdzQwoAT8tlQ8rhejopCP3rAcTNPt21RdY9/Ve0QA7DzJTUPyhetgghuY1oh4exX314a5lv10LA= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.JacobKollanukkaran@cavium.com; Received: from jerin (111.93.218.67) by SN6PR07MB5007.namprd07.prod.outlook.com (2603:10b6:805:ac::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1080.14; Fri, 24 Aug 2018 04:39:16 +0000 Date: Fri, 24 Aug 2018 10:09:01 +0530 From: Jerin Jacob To: Anatoly Burakov Cc: dev@dpdk.org, tiwei.bie@intel.com, ray.kinsella@intel.com, zhihong.wang@intel.com, maxime.coquelin@redhat.com, kuralamudhan.ramakrishnan@intel.com Message-ID: <20180824043900.GA9021@jerin> References: <4e780007ecfc3c1c5e8a249f69236b407d2e98d0.1535041359.git.anatoly.burakov@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4e780007ecfc3c1c5e8a249f69236b407d2e98d0.1535041359.git.anatoly.burakov@intel.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: PN1PR01CA0109.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00::25) To SN6PR07MB5007.namprd07.prod.outlook.com (2603:10b6:805:ac::33) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cec9a1a7-a7d1-45f5-f5bf-08d6097b8e6f X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:SN6PR07MB5007; X-Microsoft-Exchange-Diagnostics: 1; SN6PR07MB5007; 3:jJI6SCbTooJybAhPF+lSMWCMPj8tAHK6XpubYiW6vAkmFlzs5jsZ2eZ01Fe8YmRFv5KzLfz/0crA2E7T4O9JDYvBLuicgJVVxhcZqRgqF0UlIODrQ1MnLPjLxstFMUuZ0sih1QiwPycGroie96azEAuvdQznB55yQvu0G5vleHSc3zPh68b3ILd/qByxAtqeqDRRsIMq6qzZ4nvFDUybAiJjy5qu3oOedJ28jk9rrHvW8Bi58IKeeASmffMyahzR; 25:ssqEuO3RqY/IBFEI6tS1We3/lQkBW8LUgg3Tc9VJJl8TQ43RWeAPAL4ZGRiKIJf8Hlan8MUrpQ/VwxypEFvbSORDkOOwWE71/x7JJL4pVeSbTZvW77nVRBqHsizA4Vzpl16tiEdfOs0kPCldQO9I5mjjcKL88YTNA8G8/4RYckeSEAKfjjszmhmeHi43rwPI/uha4uwApa8EpUKrY9nxIVdcw579BOIiJ6pWAhpqj5Gi2TRmumQF/RBgL2a62r2WRlvKPduDy+BzX9IKNHx9PgoF+RYfCQInNlx/dcWEJmAOEqzV9xXQyHu388jO+EZiy63HW78Q2ZWN2ge8lb6EyQ==; 31:g0V1gqX3SrJMNgh+ZuOanhIWEaQy6TlbmXVixEvBY7FeHw0Jti6mar0xZ9ZYf+JhrAbc9uBTEklId64/1aKDH+cPad3Wk+lLd4V+w63qi23RZ+UH0Df6kFy8Phen4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HK/fjw2KWCpI2fBFxtVmMV/YunVgp5sBO/sAlaUULZJCjEK0TmArA X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(228905959029699); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(10201501046)(3231311)(944501410)(52105095)(93006095)(149027)(150027)(6041310)(20161123558120)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123560045)(201708071742011)(7699016); SRVR:SN6PR07MB5007; BCL:0; PCL:0; RULEID:; SRVR:SN6PR07MB5007; X-Forefront-PRVS: 07749F8C42 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(979002)(366004)(396003)(136003)(376002)(346002)(39860400002)(13464003)(189003)(199004)(105586002)(386003)(186003)(16526019)(5009440100003)(106356001)(956004)(47776003)(55016002)(72206003)(97736004)(478600001)(26005)(9686003)(53936002)(5660300001)(6916009)(42882007)(23726003)(1076002)(6116002)(3846002)(6666003)(229853002)(486006)(11346002)(446003)(476003)(66066001)(316002)(16586007)(58126008)(33896004)(33656002)(50466002)(33716001)(76176011)(52116002)(68736007)(6496006)(8936002)(4326008)(2906002)(8676002)(81156014)(81166006)(44832011)(25786009)(6246003)(7736002)(305945005)(18370500001)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN6PR07MB5007; H:jerin; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN6PR07MB5007; 23:ezhiMp73RyXZSRSwgtMZ3v4MkcH2WPseSfAdCbSur?= =?us-ascii?Q?XgZzSljax3Iq8xYjZt7mO1/J+orTYg+cwW3Wdc+uGbi2RgLFxQkzZ2P2jybx?= =?us-ascii?Q?eBUUsCM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eI2OhF?= =?us-ascii?Q?rnJ0p1NgllFQ2UkrjPKjbOKCag4alqGrODuuU0YaqffoeOmsAhbEz3GVR7mD?= =?us-ascii?Q?ReZEtSrwUX/vfin31Efvk16E+3d62ts9pkNgf+axlE9i+woKwsrYJ3U6GEMb?= =?us-ascii?Q?EpyMwunIB0PmPSZw/8d3AYp6xZ6xUqWwJa6qTOcHfg7bQRjZDRs7L9e5TJjq?= =?us-ascii?Q?Vf66g4sl6THkChgDm4SyrkgYDBRtq+mqTxa4vz78oKrbGibPOjc2aJLR/AVQ?= =?us-ascii?Q?XfPemq5XyP823tdFw4uydpG4LBc5Pp9+9OjR1sWMAGuXbnIJ+wsm88A1j4WU?= =?us-ascii?Q?iwgK2RJu1gTMFiCK00rmwSqRGM/aDrK5h6VpAF5uoAifL8JttD1j0HJpUWEY?= =?us-ascii?Q?Ct6skEU3erQK22aqH6b+S4kuqtt7QwJAJv6FLxwTvnKittw7tAXhqJgoC2SH?= =?us-ascii?Q?hEruzfrPooE93bcRAgXcFJkN97L8yA=3D?= X-Microsoft-Antispam-Message-Info: 4+OHnyKbdjJd/rM9kj4FhEkSaJXGNfPrJp4yPqXhpwd7EQMuy79tTPYj6MIo52tC454E3Vv3jTtZoLutMb8mJgA/Zom4eJnED6Z2SKVroYyDJLmAlkFRwqSK4vKph/unCxRdxAANhDzvc2s5eICbvgO3a4ceCzfyqjL6pLR2nUGI4OiGKerk0rkZWSn7DCmcxk807MQWrBEdOmJCWhnmnIYOJ34TGGPj4CqF+X+RW+JJutbjvNexto9e5SBCsmb06xwE73bsiUgoIXsaAfDJtCvnBOoOxQamt0kOQPeF+othIOEEwEOP4I1G1oETlKSElN67xof9ERi7ZxzHA7lRK2BUWNc0ZaUIXtva5jY/SWg= X-Microsoft-Exchange-Diagnostics: 1; SN6PR07MB5007; 6:JQicJRCUrqmY9qCrziXm/+jyfD7J4YPkZqzzj42+zeNZ9rjkEfg5C1PPQnYqSwpg6duNLAsOXDEc41MD07AayGOPKMj2xXsfj7XL02rU5uVO0uFjfojdwFoCmJVYtMdwtyjSFzzkQPTfTrBS9u8upaSCWuj4oKcaanxE0qIGvn8irc8Qhc/Oj6irPFNWyrozlblARImykvLNW2iu7AifJyfl3ncLmpmBuGaZDK+KB7rWT83QEYeg3BIRquERlKhVKHpzHqKGchpe3Uzq+pPGfNORohr4epsFMBHGckTcejTW87t2IhZx9+aaH9MJyc9yI+BAT9kw3NehBnbt2d+aKvwbIXjoVODZYLVxuAknflsieLYDUeBHT+2K/75n6d9TVAaB/oDibclJXt1Ddb/jNeKxR+wxSAgFMhT0xG27D+XeOx0Rr5UneNo7zQAhvtzTq46/AfbOl39UBH4HElnt0A==; 5:744xx2YAHU7AJVe7tYaBrDuS1LnXklleDimG8KB5+n/cSSifczTsrUJTdu9rrC18fB6uTOyVIu/XRBUGgmDRkpSDLpJGgGZ+9xSXIQSSwvTfvKzurD4kfFG1eI242t0VqbjqxvsiE8aw4Yp66uKcVlHgcUtxjW9fOQo4fvDxss0=; 7:sYyj03WD8tCklMvIhZbdVI/vBYT27UwYJfRO2+O4/fRLJmACX3KyI3brwLYvzFthIjIq9aJfqm9j46qJj/TNRAaXl0VZKiSExjMEmXB8TuubRWGFQ4pBRB2wcqcACw7OxUeKQEEixbQuX3r7zgtv3rW+ZxqBaRMNs7gWqIvUSaUeeVqO8Jw4OtuMgRyGl1b1Yv6yKZY5VLlerFRsYtuZpUoYeoVOT8XAWf1LmadOfjqjJoPXLHHte2kfVM7up19g SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2018 04:39:16.9225 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cec9a1a7-a7d1-45f5-f5bf-08d6097b8e6f X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR07MB5007 Subject: Re: [dpdk-dev] [PATCH 8/8] mem: support using memfd segments for in-memory mode X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Aug 2018 04:39:22 -0000 -----Original Message----- > Date: Thu, 23 Aug 2018 17:59:55 +0100 > From: Anatoly Burakov > To: dev@dpdk.org > CC: tiwei.bie@intel.com, ray.kinsella@intel.com, zhihong.wang@intel.com, > maxime.coquelin@redhat.com, kuralamudhan.ramakrishnan@intel.com > Subject: [dpdk-dev] [PATCH 8/8] mem: support using memfd segments for > in-memory mode > X-Mailer: git-send-email 1.7.0.7 > > > Enable using memfd-created segments if supported by the system. > > This will allow having real fd's for pages but without hugetlbfs > mounts, which will enable in-memory mode to be used with virtio. > > The implementation is mostly piggy-backing on existing real-fd > code, except that we no longer need to unlink any files or track > per-page locks in single-file segments mode, because in-memory > mode does not support secondary processes anyway. > > We move some checks from EAL command-line parsing code to memalloc > because it is now possible to use single-file segments mode with > in-memory mode, but only if memfd is supported. > > Signed-off-by: Anatoly Burakov > --- > lib/librte_eal/common/eal_common_options.c | 6 +- > lib/librte_eal/linuxapp/eal/eal_memalloc.c | 265 ++++++++++++++++++--- > 2 files changed, 235 insertions(+), 36 deletions(-) > > > +static inline uint32_t > +bsf64(uint64_t v) > +{ > + return (uint32_t)__builtin_ctzll(v); > +} > + > +static inline uint32_t > +log2_u64(uint64_t v) > +{ > + if (v == 0) > + return 0; > + v = rte_align64pow2(v); > + return bsf64(v); > +} > + Can we move this to lib/librte_eal/common/include/rte_common.h? It has already rte_log2_u32()