Received: by 2002:ab2:2994:0:b0:1ef:ca3e:3cd5 with SMTP id n20csp118088lqb; Thu, 14 Mar 2024 07:03:15 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWMk/s5sOz97crjHOK/fQD4A5MyXY/Leo6d+JN9vy3aDcQKvFhDgO6PhnJGh6Sl4eUOEVAf7d0simniaoFmr4YestD3PZDaAOkPH+NUOw== X-Google-Smtp-Source: AGHT+IF6xa/Nk9YwTYRcHvRAtbMHoJFQaBpwg+cdf0SEXZqjU7ZO8Ckk/Mmwj8UrSKWz/vWn64n0 X-Received: by 2002:a05:6a21:181:b0:1a3:26b5:c7bf with SMTP id le1-20020a056a21018100b001a326b5c7bfmr146306pzb.47.1710424994733; Thu, 14 Mar 2024 07:03:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710424994; cv=pass; d=google.com; s=arc-20160816; b=sElhg/QSc0qC8Gx30S31EHqfBGYfvMQr7xbR8wSqCPdHT9HEGNIGnNQkE4Dm8LvpDR XdLgECoOEfjv65nLC7iKe+jCTraFgeqc+hw/l4IaZNnzNjf4i2sw1DPnPnoOrI/nze89 ZUuUyQ9a5VLLZxu5WwmYjvIxHNkMICVTDy0nvwX96iHKV2GlfNVkPnAUQ8Ryqsx0n3Ej EcYI9FYDHWtKTO2EWlRiizALvAk5/sltqSRnQpAo8vxgl2QKPdgIuqipgZJu4/v5hG7A De03uWx8JGq2nMv9ex0SSQ7Z21YI6VuaMixElIjfjG9zQ48q6Rk9G/rz6liw4S3CaKHm K5qw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=/0LZ9JPaPO9MvJ92RSmTjppyGkKV74icycuPX6dPtYM=; fh=3P9U2je59HThLgQlLQZWOl85BmvPPK+oWbmp2QDi5uc=; b=IRH6dk7GotLzeeSslTmiiGzMdm9RYyCU7sS/Xd+S4NrW3RhtSbXDLa4Rl0gmFI9D5I CJaXbmDWdCevcEozDcq+PzotuWe/0rN4fkZTLKl5nJvPmQXu3hSlTurNm0Z6ZrjcwknY 9OtBq8E+2YWRxsaHETDLWr6MIxMMe4fGRE6auZL9en2gyzoM7o/TTbBrXzZEtOyDhUT4 TYY+Ff4tmQ84pAXva7cpUwhN835yaQXosUMFKJagiQX5K4mVEFQ1XsEu9NWCdnroSFmr d+P/ojleVegxQkugsuGW5u5GPkZBdqewklLjDvam+UXHPggiwIFiJvxGF1pN8KMxesCN DAlw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@soleen-com.20230601.gappssmtp.com header.s=20230601 header.b=s+8dfp8o; arc=pass (i=1 spf=pass spfdomain=soleen.com dkim=pass dkdomain=soleen-com.20230601.gappssmtp.com dmarc=pass fromdomain=soleen.com); spf=pass (google.com: domain of linux-kernel+bounces-103324-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-103324-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=soleen.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id h17-20020a632111000000b005dc4fbfb9acsi636358pgh.583.2024.03.14.07.03.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Mar 2024 07:03:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-103324-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@soleen-com.20230601.gappssmtp.com header.s=20230601 header.b=s+8dfp8o; arc=pass (i=1 spf=pass spfdomain=soleen.com dkim=pass dkdomain=soleen-com.20230601.gappssmtp.com dmarc=pass fromdomain=soleen.com); spf=pass (google.com: domain of linux-kernel+bounces-103324-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-103324-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=soleen.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id EFB5828547F for ; Thu, 14 Mar 2024 13:53:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3198F6EB56; Thu, 14 Mar 2024 13:53:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=soleen-com.20230601.gappssmtp.com header.i=@soleen-com.20230601.gappssmtp.com header.b="s+8dfp8o" Received: from mail-yw1-f179.google.com (mail-yw1-f179.google.com [209.85.128.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A23EB5C5F3 for ; Thu, 14 Mar 2024 13:53:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710424388; cv=none; b=TZ5Qw2BOciZpZe7DIPTGVkhUWenmZSq4ReP7VjUM3O7DQ3i5P4rYnTNqccBrOT8/VfestmRnfA+s4YLGZSEFoYW8uxx/xEKlgg6hxd6+0m0fs9F6zLg7kCJnr01oM8Viude/rTmkf3zVNY0idC4mrQQTdOH5yNYiDnLKAZxR3NM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710424388; c=relaxed/simple; bh=JLVebvTemgm2DMTBFylq41rCSroLoQJOOk4UqmDML2k=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=CZquqjQfWRpbsWYNiqX3GIzX4/+2mERRK5IqKqhZ9zN6qXFKHNhK6eEw/VNFwsy3+FiBGMJB4sgf5OQhDfJ8drDchqecifOu02+L+t73fugSkIuenW7A+HLTaeMt1k3pB7nmnEetWhVDM/taEOAldY2QaLlPUmfMhiFde9LASBc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=soleen.com; spf=pass smtp.mailfrom=soleen.com; dkim=pass (2048-bit key) header.d=soleen-com.20230601.gappssmtp.com header.i=@soleen-com.20230601.gappssmtp.com header.b=s+8dfp8o; arc=none smtp.client-ip=209.85.128.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=soleen.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=soleen.com Received: by mail-yw1-f179.google.com with SMTP id 00721157ae682-609fc742044so10968777b3.1 for ; Thu, 14 Mar 2024 06:53:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen-com.20230601.gappssmtp.com; s=20230601; t=1710424385; x=1711029185; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=/0LZ9JPaPO9MvJ92RSmTjppyGkKV74icycuPX6dPtYM=; b=s+8dfp8oxd+tQ/fG2/d6F8Nc9en3gM0RFYApm3kHxfoz/+r4UxNS/C4GmNf1aQYZo0 wv3uqs7h2rdaUMul23DwcxL3gnTBbORfUlI5RdefGFabFn/yRVPGHEml0pAtGOfEBdpg wkqHkZKFRF0h8Q7lsc8EUMmgTPd6dX4rfIup6J2ICGAbdZPHXcow5kVVC08D0YYmG/um o56avz5kCZorRv1M1o5PGEPBbhw1fUjWY7j8Gibob5Ah4GqswKuwBmdH+yzdtpUwxFpZ Qc4gc2pIYLmh9xZxqjpaL1zoMfvnX/UKGEMGNGn4i/+RLJmySDEu4W1iHs/QlbJVZGdZ s6JQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710424385; x=1711029185; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=/0LZ9JPaPO9MvJ92RSmTjppyGkKV74icycuPX6dPtYM=; b=Uz3wGfPwBHBQknszOeFLPbQDWVZLU/57QjvYlMriIKdR4IkSm5Ltrx2jwp6ezR7t4C twBOKOocxPIKd72gYNvdhZMQpvQTGwpYMFUj+iaOMDQkVHiXhx9JtyEqZxlqTb/l1CPR tGI1J6g2h4UcHmJlovpX3gaLHYrYUnFf3ctPskZ2wcL5clqjMgDvwu5J/hOhz/JbqTPz fNwmkM491+6ERlMVluX3DXaf4Fsvp6jM+2gyzAa04MVPG45VWHfKE0Qw9HQAuoD+nXzC CEDVjI2Ke8BCQfRBr6s24fe9kNpDu7VvPs1jfuJptp5cmziwSkZkEZUgWz5cV9EBMStn x3lg== X-Forwarded-Encrypted: i=1; AJvYcCXKNpbbDi8Ngc9aTfq9AHPg4LQ/00g0BIossbn0Pz7Eum9zFPJG/toIowM9j/pZRCRUEUBgccud1oljaE8ZGca2Bc6xiKfno4ysFbGT X-Gm-Message-State: AOJu0YzEZYswOfsaot28Mevsufsww1dXBBx0M17gFmUs0rK3AFKEiydY t6OGsibDtCf+5V81u4Pdd9BVtN2GFGWDvrZ6bJ770miyk31XO/fPKKrQJogokb11vSU5X2BIUTR AxzWtEYhLbp7aP9H90QMPlElqxeb06q5wRJWXuA== X-Received: by 2002:a81:5208:0:b0:609:f7cc:4bb7 with SMTP id g8-20020a815208000000b00609f7cc4bb7mr788909ywb.46.1710424385457; Thu, 14 Mar 2024 06:53:05 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240311164638.2015063-1-pasha.tatashin@soleen.com> <20240311164638.2015063-7-pasha.tatashin@soleen.com> <6f351959-4711-4a21-8c46-94e536d2eff8@csgroup.eu> In-Reply-To: <6f351959-4711-4a21-8c46-94e536d2eff8@csgroup.eu> From: Pasha Tatashin Date: Thu, 14 Mar 2024 09:52:29 -0400 Message-ID: Subject: Re: [RFC 06/14] fork: zero vmap stack using clear_page() instead of memset() To: Christophe Leroy Cc: Nikolay Borisov , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" , "akpm@linux-foundation.org" , "x86@kernel.org" , "bp@alien8.de" , "brauner@kernel.org" , "bristot@redhat.com" , "bsegall@google.com" , "dave.hansen@linux.intel.com" , "dianders@chromium.org" , "dietmar.eggemann@arm.com" , "eric.devolder@oracle.com" , "hca@linux.ibm.com" , "hch@infradead.org" , "hpa@zytor.com" , "jacob.jun.pan@linux.intel.com" , "jgg@ziepe.ca" , "jpoimboe@kernel.org" , "jroedel@suse.de" , "juri.lelli@redhat.com" , "kent.overstreet@linux.dev" , "kinseyho@google.com" , "kirill.shutemov@linux.intel.com" , "lstoakes@gmail.com" , "luto@kernel.org" , "mgorman@suse.de" , "mic@digikod.net" , "michael.christie@oracle.com" , "mingo@redhat.com" , "mjguzik@gmail.com" , "mst@redhat.com" , "npiggin@gmail.com" , "peterz@infradead.org" , "pmladek@suse.com" , "rick.p.edgecombe@intel.com" , "rostedt@goodmis.org" , "surenb@google.com" , "tglx@linutronix.de" , "urezki@gmail.com" , "vincent.guittot@linaro.org" , "vschneid@redhat.com" Content-Type: text/plain; charset="UTF-8" > But the pages were already physically discontiguous before your change, > what's the difference ? Pages were not physically contiguous before my change. They were allocated with __vmalloc_node_range() which allocates sparse pages and maps them to a virtually contiguous span of memory within [VMALLOC_START, VMALLOC_END) range. > It doesn't matter that the pages are physically discontiguous as far as > they are virtually contiguous, which should still be the case here for a > stack. This patch is a preparation patch for the "dynamic kernel stack" feature, in the description it says: This is because with dynamic stacks we might have only partially populated stacks. We could compute the populated part of the stack, and determine its start and end mapped VA range by using vm_area->pages[] and vm_area->nr_pages, but that would make code a little uglier especially becuase we would need to take into the account if stack is growing up or down.. Therefore, using clear_page() is simpler and should be fast enough. Thanks, Pasha