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 581CB45AA4; Thu, 3 Oct 2024 23:18:50 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DFD9F40289; Thu, 3 Oct 2024 23:18:49 +0200 (CEST) Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) by mails.dpdk.org (Postfix) with ESMTP id 223DE40273 for ; Thu, 3 Oct 2024 23:18:49 +0200 (CEST) Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-20b0b2528d8so16262915ad.2 for ; Thu, 03 Oct 2024 14:18:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1727990328; x=1728595128; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=FOBk1dWtecVSaTW8SzmwaHuTYX6jIspKM0uyjnyB610=; b=Kq8Mr1py0x+6sFU4Zf4ljzSKIwFPfgja/RWkNns+uVEidh97JS1ltjDYXETnexauZV 5GEpwDiTB+Nck9l0exfNaKSjp3H4M5MulLXF6L6iCqlcRLCYrwNDQjinb4d5O9R5JXtW nTkWViND5o1ghtwXx1MeXhVIk8Dme13cFQz/8AfxKW7BbEDnFBPS2FPBJcc7Lo3XOEk6 7F4qPg0bmrBTJUumWaIGCDEji5Vpu/GYGaE6q1nm+atPXmu4pqnE3vL0axyNSri4Z1zx qiR/dnwCoZacvot1W/4CENpIDdVHedC9pLcWlz6Wj1sojWQ+7AZ5R4bcgF6xDd+/BtRK 9h8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727990328; x=1728595128; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FOBk1dWtecVSaTW8SzmwaHuTYX6jIspKM0uyjnyB610=; b=b0gWa4kE73uz4PW3bSPDD6gMlZiXCRHSbdwUPqPGTbQErzYvyhbajG0xXGcd5EeCfR RvtWfjTWlyXh+uNgumGqS9AfH9L69RBI6BN1QrEidzgXDJUAQ47fbXimXzGOaWQgtf7d XJ5m2lLh3ZWuNOXbFPlc89Cl30dZg0hhXJfZaoR9zZtZs04PrdD2PDbcGS+GwOoASJKi zweauixMXAWpeY3xBtiFCB3lScBUiqTqbTATIPz2+u5ggHR/K/GYLi74Y8C6GU8qbTyx /SVCeXJwfaLAkE9GKV9MBKcPlvHpJwDdUxVxL6Gxosn8HfCcMsugs0F9/nVtrIQ16n4H NRJQ== X-Forwarded-Encrypted: i=1; AJvYcCXaZ9Rd8Pi/x6FTGkRbSmJ5183kphQLGfsPgbHqtetK6+rPEYPN7thrF0SuvMeSe9aND2A=@dpdk.org X-Gm-Message-State: AOJu0Yzj5i//r5pCl2WbAarly98zm3xw/MdF1niwm6joOJ8m6XNNkgvW A27ZsOpMPsC8uS17shANZcmg7p5jNG5SLHZ2FnTb5Sa6Rh0fkFq8Xr5iRZZVrUs= X-Google-Smtp-Source: AGHT+IH1a9WPqdRFKmPN+LxMSCg3kx6OzL/e+KwogPVi6LI/fuf07QWEef3TNCCKVyB2g+fr25XYRA== X-Received: by 2002:a17:902:b20f:b0:20b:7e0d:7c with SMTP id d9443c01a7336-20bfe3a01f6mr4627225ad.41.1727990328105; Thu, 03 Oct 2024 14:18:48 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20beeca2256sm13234615ad.91.2024.10.03.14.18.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 14:18:47 -0700 (PDT) Date: Thu, 3 Oct 2024 14:18:45 -0700 From: Stephen Hemminger To: Artur Paszkiewicz Cc: anatoly.burakov@intel.com, dev@dpdk.org, david.marchand@redhat.com Subject: Re: [PATCH v3] mem: allow using ASan in multi-process mode Message-ID: <20241003141845.1f37f3c4@hermes.local> In-Reply-To: <20231025092717.2069-1-artur.paszkiewicz@intel.com> References: <20231004142308.15395-1-artur.paszkiewicz@intel.com> <20231025092717.2069-1-artur.paszkiewicz@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 Wed, 25 Oct 2023 11:27:17 +0200 Artur Paszkiewicz wrote: > Multi-process applications operate on shared hugepage memory but each > process has its own ASan shadow region which is not synchronized with > the other processes. This causes issues when different processes try to > use the same memory because they have their own view of which addresses > are valid. > > Fix it by mapping the shadow regions for memseg lists as shared memory. > The primary process is responsible for creating and removing the shared > memory objects. > > Disable ASan instrumentation for triggering the page fault in > alloc_seg() because if the segment is already allocated by another > process and is marked as free in the shadow, accessing this address will > cause an ASan error. > > Signed-off-by: Artur Paszkiewicz > --- > v3: > - Removed conditional compilation from eal_common_memory.c. > - Improved comments. > v2: > - Added checks for config options disabling multi-process support. > - Fixed missing unmap in legacy mode. > > lib/eal/common/eal_common_memory.c | 7 ++ > lib/eal/common/eal_private.h | 35 ++++++++++ > lib/eal/linux/eal_memalloc.c | 23 +++++-- > lib/eal/linux/eal_memory.c | 101 +++++++++++++++++++++++++++++ > lib/eal/linux/meson.build | 4 ++ > 5 files changed, 164 insertions(+), 6 deletions(-) Makes sense, but patch has some fuzz against current main branch. There is also another patch that address the ASAN touch issue. https://patchwork.dpdk.org/project/dpdk/patch/20240723083419.12435-1-amichon@kalrayinc.com/