From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2B20E36B17 for ; Fri, 26 Apr 2024 21:58:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714168718; cv=none; b=Oa/uGt9V7YcBCHrMZMWHCD1qF5/rCsTdoVhd2bm++Xy1Y/Gvc/1dOPQjEhpvVJpLoFXi2qkKbIpYOIlMjzzkC/LCX7n52kuw0B4ORIfphIDY6LYIA3Fd6sQMmX/RrtnWFAJfUCsEEfVC6mO5m2ICUhlADiEpSDEszwwZ2kKiFeo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714168718; c=relaxed/simple; bh=GpKDeVd3Be5OZTf7mdPRg/LKaWMV3/RuUFvbHOM6pQ4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=GCykGKQTvNTrYhgxJ7M/xY0k/+tfvZzf5bQO74/xyoh22kTDRY2WrCrtOIsfOrybVAtvaicUdGS0cz3DLYEi8tNYr34aUlM92HiB8b+0Y3/ptQDYfmAHJvGmUDQlNsWNgCpYZbwhNIc/ZxL0846OENI92dvo+IQl18iycKDZYLw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=XWAxTbik; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="XWAxTbik" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1714168716; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=+QCnlzmJ6bjL+5B5nZfc9uwhSIwhhaQo56prOJlaB+0=; b=XWAxTbikt02kzcDl1AzK22glPUXZQ+sA9GGmqMSDTagHr8atZPln4XYVTn7LaoRjuqx5u/ eUW7xbfLZOquhE1ngvmJ5tauIYj4+q4KPv494ubsaEq024i3YGyC2swINJTqvSBtQOK8p0 iKfxStbqBXhIKdCJHY6UqORqc5wRCn8= Received: from mail-qv1-f71.google.com (mail-qv1-f71.google.com [209.85.219.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-42-k-txOjrPOg6BhY8rOgn6AA-1; Fri, 26 Apr 2024 17:58:34 -0400 X-MC-Unique: k-txOjrPOg6BhY8rOgn6AA-1 Received: by mail-qv1-f71.google.com with SMTP id 6a1803df08f44-69b147e856aso6633986d6.1 for ; Fri, 26 Apr 2024 14:58:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714168714; x=1714773514; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=+QCnlzmJ6bjL+5B5nZfc9uwhSIwhhaQo56prOJlaB+0=; b=EFFoA9HRCNDUyEyeKI0IL2iUk2Kh0aAnEX4ckadol4hv/RaSeHuZox/CLH1DV0v69f WS5VkYLdSHSs4lrWBxIeMIIxNCxv0MqFN9jMu8qy+wPexuBAYLOVdsttt/jezY81a+2x nRAdaGSLvlGeoBM0Bustepi2hx8iKkWkv1sXUnOx8nLc2Z/NfUJvci+1L7KVB9W4EQFS rFauGCXnJaHg+N0nRVAevLHBVhvmkc/8B701O3iUMfzLLTXMfRDx1qTTSgu4VfGJslwV qU6T4l765MJR6XNXd7iY9s4WRUDYifq3JG3JvPCZibgy39xqiwUDlPQ6CAkNZneoVHK3 9cCg== X-Forwarded-Encrypted: i=1; AJvYcCXnYGZQ+lIS2pSagJQqz6nmtOFfhbIMCjREzuGe7dRgaMg+ARJ+ZLMh+qQLG2EPLJ3z9jybyrRWDLrzdqgSgJmB7Gy1ETcUg1V4ow== X-Gm-Message-State: AOJu0Yy6vNNhVomkuL1rWh3xQ+Rh19AL8Zo7LMHR4IbICYr+jTD6txq1 DDMVeVMtaCWntUCJ0Bw3iw/3MLMsfv5m2lzlAeV1v6MXm4Uqi+KB25JKl661XIRI/eDUTQoyEpc +ngrytz1mfjAbgHuBDXwOc0qsZ4y4jTcAAe90Q+K/LoYxq7RubMU67bLRCrU= X-Received: by 2002:a05:620a:17a7:b0:790:95ad:9260 with SMTP id ay39-20020a05620a17a700b0079095ad9260mr4428399qkb.0.1714168713781; Fri, 26 Apr 2024 14:58:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH9TXpTvynaKbMe+uWh4XQxgfNR94gVb6jB/4BIiWgOtfhaqFyr6WLW6qYoOzAm6Sij+K5ZPQ== X-Received: by 2002:a05:620a:17a7:b0:790:95ad:9260 with SMTP id ay39-20020a05620a17a700b0079095ad9260mr4428368qkb.0.1714168713163; Fri, 26 Apr 2024 14:58:33 -0700 (PDT) Received: from x1n (pool-99-254-121-117.cpe.net.cable.rogers.com. [99.254.121.117]) by smtp.gmail.com with ESMTPSA id g13-20020a05620a218d00b00790789db3cbsm4659252qka.29.2024.04.26.14.58.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Apr 2024 14:58:32 -0700 (PDT) Date: Fri, 26 Apr 2024 17:58:30 -0400 From: Peter Xu To: David Hildenbrand Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Andrew Morton , Mike Rapoport , Jason Gunthorpe , John Hubbard , linux-arm-kernel@lists.infradead.org, loongarch@lists.linux.dev, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-riscv@lists.infradead.org, x86@kernel.org Subject: Re: [PATCH v1 1/3] mm/gup: consistently name GUP-fast functions Message-ID: References: <20240402125516.223131-1-david@redhat.com> <20240402125516.223131-2-david@redhat.com> <8b42a24d-caf0-46ef-9e15-0f88d47d2f21@redhat.com> Precedence: bulk X-Mailing-List: linux-mips@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: On Fri, Apr 26, 2024 at 11:33:08PM +0200, David Hildenbrand wrote: > I raised this topic in the past, and IMHO we either (a) never should have > added COW support; or (b) added COW support by using ordinary anonymous > memory (hey, partial mappings of hugetlb pages! ;) ). > > After all, COW is an optimization to speed up fork and defer copying. It > relies on memory overcommit, but that doesn't really apply to hugetlb, so we > fake it ... Good summary. > > One easy ABI break I had in mind was to simply *not* allow COW-sharing of > anon hugetlb folios; for example, simply don't copy the page into the child. > Chances are there are not really a lot of child processes that would fail > ... but likely we would break *something*. So there is no easy way out :( Right, not easy. The thing is this is one spot out of many of the specialties, it also may or may not be worthwhile to have dedicated time while nobody yet has a problem with it. It might be easier to start with v2, even though that's also hard to nail everything properly - the challenge can come from different angles. Thanks for the sharings, helpful. I'll go ahead with the Power fix on hugepd putting this aside. I hope that before the end of this year, whatever I'll fix can go away, by removing hugepd completely from Linux. For now that may or may not be as smooth, so we'd better still fix it. -- Peter Xu From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 65EB2C4345F for ; Fri, 26 Apr 2024 21:58:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=eP799OO52g74O/3dmF3bFGnbx605aIcjZOWktAp+DO8=; b=r5CIKV5Nua3P+g rJq0OwB8I/1bhIEGkxQxCm+LCkxMB8R7Lu6XtgEXriXl2y+qQGyllxFcAWJxO1o97ZUYYpd0ZaaER 70ysCC8isxFb1PHNJTvhkUkawbae4hcbSOoxYEjPQPdea5GPaA2OX+IAosiiZIEWcprwkeAvsn0IS ZufqJuG5kKbMecVSDX3eJe3ifNRULriwoAKzDuRB2Oqndk85g8KrpKUoohgGIGdcRp8rdhpMN1pdv ANvYmhdE1utphhJh0tDkv3f2QjhQv4J4HLOZTUdZomzqFKT7Syz//4Xh/kZFcd685idme1rwdadH0 BKf4k/OZDaaYBytw5Ztw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s0Tae-0000000EA78-3Cne; Fri, 26 Apr 2024 21:58:44 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s0Tab-0000000EA4a-3EHq for linux-riscv@lists.infradead.org; Fri, 26 Apr 2024 21:58:43 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1714168719; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=+QCnlzmJ6bjL+5B5nZfc9uwhSIwhhaQo56prOJlaB+0=; b=FohtIxpyAOCF8DOc6meag5F2/BvAH+GUR3gpQbqaYnH20Co+KtM2xF8P7YQeRZ5YABXQ3W Ry+PuueFB5DiBBUBcfewlN8C+Be1jv9vINPbsUldO1g9RJg7yb4TirhadernO4xYnH8Wk4 u1hL1yDm84XZ1Hf5GQMTj2GpkXMqMQM= Received: from mail-qv1-f70.google.com (mail-qv1-f70.google.com [209.85.219.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-644-r9CiY0YsNx2eIJ7jvBQtkQ-1; Fri, 26 Apr 2024 17:58:36 -0400 X-MC-Unique: r9CiY0YsNx2eIJ7jvBQtkQ-1 Received: by mail-qv1-f70.google.com with SMTP id 6a1803df08f44-6a094939dedso9049416d6.3 for ; Fri, 26 Apr 2024 14:58:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714168714; x=1714773514; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=+QCnlzmJ6bjL+5B5nZfc9uwhSIwhhaQo56prOJlaB+0=; b=pwaKHmQAQKVDUr+BUastVsTUoDs2hH+wkWM0xqQTTs9AScEFUSxrcm+64cNV/D4MSn EJ//VtizCqcEqtrzNIoVtDT8Og+jkC298PjfIZrBBRwJuLJf0C25gQ2ucVL2/4JAP7+6 T2F2K0YQnYSI2DKqowyKHq1zTfVVi++qYBGwA/vuA19ZQII3hTqJpRepkzK5HbiIHp0v sp9KOowFEZ4VXksPINdl0qh6cCn9+0k2josKR+DsFW+8Auo2TVh5LzUJ2G/jH3kimXCP J9LkXTVlaFeBs3Rgo6I6e6412ypKhEifxwjmk85XKRrvL6YU5VwEYGU8Us0NsELqUjaC ANDA== X-Forwarded-Encrypted: i=1; AJvYcCUigfD0QX/NmQkLO83N66M6gjA/kgU6eTcVCkYLXVo/iuXNDZShaz0o+UTeC3BYlZ2XDjlBRtvBys1efxBdlBhlDpVmAR2LqbuodnQyjfKQ X-Gm-Message-State: AOJu0YxBubffMRwedAN9c0wb4lH29b0ybZql8tZCEoWmbCe7lHvqbBBj OekOAZWWN+zFISQmdwcQDmuLKP1YxB2u/rchow1LpUAz5dI4y6ZDmjZT3RMpxao4tikZVDJv+CM LttyqpNzDHU0I4CGKWSyLT86ONEUVN0qCQUoOp7cC2/DqEZbGZRKioesKmSWkO2LNmg== X-Received: by 2002:a05:620a:17a7:b0:790:95ad:9260 with SMTP id ay39-20020a05620a17a700b0079095ad9260mr4428397qkb.0.1714168713777; Fri, 26 Apr 2024 14:58:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH9TXpTvynaKbMe+uWh4XQxgfNR94gVb6jB/4BIiWgOtfhaqFyr6WLW6qYoOzAm6Sij+K5ZPQ== X-Received: by 2002:a05:620a:17a7:b0:790:95ad:9260 with SMTP id ay39-20020a05620a17a700b0079095ad9260mr4428368qkb.0.1714168713163; Fri, 26 Apr 2024 14:58:33 -0700 (PDT) Received: from x1n (pool-99-254-121-117.cpe.net.cable.rogers.com. [99.254.121.117]) by smtp.gmail.com with ESMTPSA id g13-20020a05620a218d00b00790789db3cbsm4659252qka.29.2024.04.26.14.58.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Apr 2024 14:58:32 -0700 (PDT) Date: Fri, 26 Apr 2024 17:58:30 -0400 From: Peter Xu To: David Hildenbrand Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Andrew Morton , Mike Rapoport , Jason Gunthorpe , John Hubbard , linux-arm-kernel@lists.infradead.org, loongarch@lists.linux.dev, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-riscv@lists.infradead.org, x86@kernel.org Subject: Re: [PATCH v1 1/3] mm/gup: consistently name GUP-fast functions Message-ID: References: <20240402125516.223131-1-david@redhat.com> <20240402125516.223131-2-david@redhat.com> <8b42a24d-caf0-46ef-9e15-0f88d47d2f21@redhat.com> MIME-Version: 1.0 In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240426_145841_909288_35B8E045 X-CRM114-Status: GOOD ( 14.56 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org On Fri, Apr 26, 2024 at 11:33:08PM +0200, David Hildenbrand wrote: > I raised this topic in the past, and IMHO we either (a) never should have > added COW support; or (b) added COW support by using ordinary anonymous > memory (hey, partial mappings of hugetlb pages! ;) ). > > After all, COW is an optimization to speed up fork and defer copying. It > relies on memory overcommit, but that doesn't really apply to hugetlb, so we > fake it ... Good summary. > > One easy ABI break I had in mind was to simply *not* allow COW-sharing of > anon hugetlb folios; for example, simply don't copy the page into the child. > Chances are there are not really a lot of child processes that would fail > ... but likely we would break *something*. So there is no easy way out :( Right, not easy. The thing is this is one spot out of many of the specialties, it also may or may not be worthwhile to have dedicated time while nobody yet has a problem with it. It might be easier to start with v2, even though that's also hard to nail everything properly - the challenge can come from different angles. Thanks for the sharings, helpful. I'll go ahead with the Power fix on hugepd putting this aside. I hope that before the end of this year, whatever I'll fix can go away, by removing hugepd completely from Linux. For now that may or may not be as smooth, so we'd better still fix it. -- Peter Xu _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 53971C25B5C for ; Fri, 26 Apr 2024 21:59:25 +0000 (UTC) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=XWAxTbik; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=XWAxTbik; dkim-atps=neutral Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4VR67v5rxSz3dSW for ; Sat, 27 Apr 2024 07:59:23 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=XWAxTbik; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=XWAxTbik; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=redhat.com (client-ip=170.10.129.124; helo=us-smtp-delivery-124.mimecast.com; envelope-from=peterx@redhat.com; receiver=lists.ozlabs.org) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4VR6736nDxz3cbw for ; Sat, 27 Apr 2024 07:58:39 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1714168716; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=+QCnlzmJ6bjL+5B5nZfc9uwhSIwhhaQo56prOJlaB+0=; b=XWAxTbikt02kzcDl1AzK22glPUXZQ+sA9GGmqMSDTagHr8atZPln4XYVTn7LaoRjuqx5u/ eUW7xbfLZOquhE1ngvmJ5tauIYj4+q4KPv494ubsaEq024i3YGyC2swINJTqvSBtQOK8p0 iKfxStbqBXhIKdCJHY6UqORqc5wRCn8= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1714168716; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=+QCnlzmJ6bjL+5B5nZfc9uwhSIwhhaQo56prOJlaB+0=; b=XWAxTbikt02kzcDl1AzK22glPUXZQ+sA9GGmqMSDTagHr8atZPln4XYVTn7LaoRjuqx5u/ eUW7xbfLZOquhE1ngvmJ5tauIYj4+q4KPv494ubsaEq024i3YGyC2swINJTqvSBtQOK8p0 iKfxStbqBXhIKdCJHY6UqORqc5wRCn8= Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-643-xWi-S8KZMRy89KOe3lo_jA-1; Fri, 26 Apr 2024 17:58:34 -0400 X-MC-Unique: xWi-S8KZMRy89KOe3lo_jA-1 Received: by mail-qv1-f72.google.com with SMTP id 6a1803df08f44-6a094939dedso9049386d6.3 for ; Fri, 26 Apr 2024 14:58:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714168714; x=1714773514; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=+QCnlzmJ6bjL+5B5nZfc9uwhSIwhhaQo56prOJlaB+0=; b=q6UdXSe8Cyf+AiykVU2hURygDjGOaPKrf0w1n6EVMLxj1uJR+HPe/la2xMJ0ymmb9f SkPTxkcE5KMwQ8kLHqgQ6Ca+TFXZVIVwZHCVKRKb/h6b3SiyhuuYwKwx+0Jk0otjwMuo f85A9xID5n7Y5dfQg6PVt8w2SgWkHJ9Q7C87JpJS3NX9LJyjwA8FKmlNj013QexTsxtk 6jhkUGeraSZmfAaHK3pHEg9cHCKWkoYqlb3TnXVTQqj8qzGmy0AmM/ThZSPyBiFrbZWS F3TV+hMhWvElQpfkRk46NpdfQhGYj1McoG0y/rU4UOkXaEClt1y9HbP49ky+PHMX6088 2PTQ== X-Forwarded-Encrypted: i=1; AJvYcCWV7mnJsUu2rkGKvVL4wEh9pbV0C3FR9y8oUZdCEkPBQ0IJ+fo6U1+foVTnuwwfSpKsF6SMCvuMjXL5bZ84hGp1QErijupeV2WMlOn9Lw== X-Gm-Message-State: AOJu0YzoJC7DV4ny6ElwH2pijusFjgUWw+JSbnPV8zdPeQoEdSu331Hh TL7/i3UsXY4RNwqnZA5jm+jWFlumeOyCiIu1Ay8iH3pv9DL8Wpe8WuMPBUrbLNJRpZAfzcSv0tA cUy6DkpzwBOiycPJSFycsVKcxKrUkuJShAzq4fj+vHff5Wezz7yqT5GpIsDaKFOs= X-Received: by 2002:a05:620a:17a7:b0:790:95ad:9260 with SMTP id ay39-20020a05620a17a700b0079095ad9260mr4428395qkb.0.1714168713776; Fri, 26 Apr 2024 14:58:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH9TXpTvynaKbMe+uWh4XQxgfNR94gVb6jB/4BIiWgOtfhaqFyr6WLW6qYoOzAm6Sij+K5ZPQ== X-Received: by 2002:a05:620a:17a7:b0:790:95ad:9260 with SMTP id ay39-20020a05620a17a700b0079095ad9260mr4428368qkb.0.1714168713163; Fri, 26 Apr 2024 14:58:33 -0700 (PDT) Received: from x1n (pool-99-254-121-117.cpe.net.cable.rogers.com. [99.254.121.117]) by smtp.gmail.com with ESMTPSA id g13-20020a05620a218d00b00790789db3cbsm4659252qka.29.2024.04.26.14.58.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Apr 2024 14:58:32 -0700 (PDT) Date: Fri, 26 Apr 2024 17:58:30 -0400 From: Peter Xu To: David Hildenbrand Subject: Re: [PATCH v1 1/3] mm/gup: consistently name GUP-fast functions Message-ID: References: <20240402125516.223131-1-david@redhat.com> <20240402125516.223131-2-david@redhat.com> <8b42a24d-caf0-46ef-9e15-0f88d47d2f21@redhat.com> MIME-Version: 1.0 In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-s390@vger.kernel.org, loongarch@lists.linux.dev, linux-sh@vger.kernel.org, John Hubbard , x86@kernel.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, Jason Gunthorpe , linux-fsdevel@vger.kernel.org, Andrew Morton , linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, Mike Rapoport Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Fri, Apr 26, 2024 at 11:33:08PM +0200, David Hildenbrand wrote: > I raised this topic in the past, and IMHO we either (a) never should have > added COW support; or (b) added COW support by using ordinary anonymous > memory (hey, partial mappings of hugetlb pages! ;) ). > > After all, COW is an optimization to speed up fork and defer copying. It > relies on memory overcommit, but that doesn't really apply to hugetlb, so we > fake it ... Good summary. > > One easy ABI break I had in mind was to simply *not* allow COW-sharing of > anon hugetlb folios; for example, simply don't copy the page into the child. > Chances are there are not really a lot of child processes that would fail > ... but likely we would break *something*. So there is no easy way out :( Right, not easy. The thing is this is one spot out of many of the specialties, it also may or may not be worthwhile to have dedicated time while nobody yet has a problem with it. It might be easier to start with v2, even though that's also hard to nail everything properly - the challenge can come from different angles. Thanks for the sharings, helpful. I'll go ahead with the Power fix on hugepd putting this aside. I hope that before the end of this year, whatever I'll fix can go away, by removing hugepd completely from Linux. For now that may or may not be as smooth, so we'd better still fix it. -- Peter Xu From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DCE81C4345F for ; Fri, 26 Apr 2024 21:58:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=y0QrkZoCjF9saw7pW0AqMMWCzhqN+dFFNCktNILQRMc=; b=m3QIeCRIfKwjJH ByhpYZJ3R4FE1YahmAi94yjCviFy1xXiSScfOft0wEExSsEmn+6kH3QeSS9J/7ZS2zBRUktGAlvV7 JusFmec+R8wtjTRWMtO8nYCsRbRb4eUfZ0AgluTdkeNRBySxum/ObFTySB/+0UL5+QvVEoj4RimAZ uaihUNiZOSMFiLljJ1mlUGVsbu9Spj3f8vvhRvqUJo6xxWlg3vTMEGo0fbWpkZWbnVvNLzHYKFECx /pbmnf6QbBZlcuDKGF6TIxxpsocps+y6vXPevwpOxOYMOMAoTXM8INVq6CQBGJ8M/sfTaoo8ul29O YhSOsA5+VHQzfrnEzacA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s0Taa-0000000EA5A-3PhT; Fri, 26 Apr 2024 21:58:40 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s0TaX-0000000EA3l-3Pb5 for linux-arm-kernel@lists.infradead.org; Fri, 26 Apr 2024 21:58:39 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1714168716; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=+QCnlzmJ6bjL+5B5nZfc9uwhSIwhhaQo56prOJlaB+0=; b=XWAxTbikt02kzcDl1AzK22glPUXZQ+sA9GGmqMSDTagHr8atZPln4XYVTn7LaoRjuqx5u/ eUW7xbfLZOquhE1ngvmJ5tauIYj4+q4KPv494ubsaEq024i3YGyC2swINJTqvSBtQOK8p0 iKfxStbqBXhIKdCJHY6UqORqc5wRCn8= Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-643-Kq2m7tPsPymcUqI0I-7gMg-1; Fri, 26 Apr 2024 17:58:34 -0400 X-MC-Unique: Kq2m7tPsPymcUqI0I-7gMg-1 Received: by mail-qv1-f72.google.com with SMTP id 6a1803df08f44-6a09e3be98dso5539446d6.2 for ; Fri, 26 Apr 2024 14:58:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714168714; x=1714773514; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=+QCnlzmJ6bjL+5B5nZfc9uwhSIwhhaQo56prOJlaB+0=; b=vVoxQBsBHxVCjwAgPRTYLEInCnNKSl3hPlBP/7gfEcept3o/7aOaxA78hI8/kAFXj+ g0JCZqY7QcpjWUbKsx1uS6aeRVkmvaIsGP6BT6eM/wHFxbFIwZwfJ2rhJmpEVv3Gv385 cm2vZOpejXyOb0Vyo7mVQ/qidBMVA9TJ1cnUWaYdDHBJRhi3kEuVoZ36adA9Fi29sjSX AW9Yvk3wEvlRsBOiT2QVyzPhO6b7alK+KeJ1jPCHUorKq3OkzjyerSDL+5yi7zE8rO5u 711ejnWk/AyhkIRmcuTuYPxTu6Jk5iMyFkCom5WXWZUfxrYzbdxtNU/w7+ea0fAbV2A4 d//w== X-Forwarded-Encrypted: i=1; AJvYcCXq8/lAr38gCii+aH5NLnMlccN43XZ6lA2I3ne4AYRLne1O3jFbuLk9Sf9whCwD8pBptUN/Ra22vOL1Rjafwx2l+LjMeA6yQBPQb3/WXY9VGNaRzKg= X-Gm-Message-State: AOJu0Yx1BEKV6ORb9Q04OcyHKygCxG5Xuav+e1+HdjPF75ImYES+QWO0 +Ib2Ki62F3BMIPHURtB7i8i4yUaVNS34x2ZB27wvavL4pxsdE7GqQPWBwxYxvPWx4s/cpzSvDEq n6LifEueKXXI/tT/3wHdB88NRw5QpoYwwjoHr9dU4c500U1jSP7Xj15UlMgdRIG1tUTuloTQucd vd5Bhf X-Received: by 2002:a05:620a:17a7:b0:790:95ad:9260 with SMTP id ay39-20020a05620a17a700b0079095ad9260mr4428400qkb.0.1714168713785; Fri, 26 Apr 2024 14:58:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH9TXpTvynaKbMe+uWh4XQxgfNR94gVb6jB/4BIiWgOtfhaqFyr6WLW6qYoOzAm6Sij+K5ZPQ== X-Received: by 2002:a05:620a:17a7:b0:790:95ad:9260 with SMTP id ay39-20020a05620a17a700b0079095ad9260mr4428368qkb.0.1714168713163; Fri, 26 Apr 2024 14:58:33 -0700 (PDT) Received: from x1n (pool-99-254-121-117.cpe.net.cable.rogers.com. [99.254.121.117]) by smtp.gmail.com with ESMTPSA id g13-20020a05620a218d00b00790789db3cbsm4659252qka.29.2024.04.26.14.58.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Apr 2024 14:58:32 -0700 (PDT) Date: Fri, 26 Apr 2024 17:58:30 -0400 From: Peter Xu To: David Hildenbrand Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Andrew Morton , Mike Rapoport , Jason Gunthorpe , John Hubbard , linux-arm-kernel@lists.infradead.org, loongarch@lists.linux.dev, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-riscv@lists.infradead.org, x86@kernel.org Subject: Re: [PATCH v1 1/3] mm/gup: consistently name GUP-fast functions Message-ID: References: <20240402125516.223131-1-david@redhat.com> <20240402125516.223131-2-david@redhat.com> <8b42a24d-caf0-46ef-9e15-0f88d47d2f21@redhat.com> MIME-Version: 1.0 In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240426_145838_274603_99BF592B X-CRM114-Status: GOOD ( 15.90 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Apr 26, 2024 at 11:33:08PM +0200, David Hildenbrand wrote: > I raised this topic in the past, and IMHO we either (a) never should have > added COW support; or (b) added COW support by using ordinary anonymous > memory (hey, partial mappings of hugetlb pages! ;) ). > > After all, COW is an optimization to speed up fork and defer copying. It > relies on memory overcommit, but that doesn't really apply to hugetlb, so we > fake it ... Good summary. > > One easy ABI break I had in mind was to simply *not* allow COW-sharing of > anon hugetlb folios; for example, simply don't copy the page into the child. > Chances are there are not really a lot of child processes that would fail > ... but likely we would break *something*. So there is no easy way out :( Right, not easy. The thing is this is one spot out of many of the specialties, it also may or may not be worthwhile to have dedicated time while nobody yet has a problem with it. It might be easier to start with v2, even though that's also hard to nail everything properly - the challenge can come from different angles. Thanks for the sharings, helpful. I'll go ahead with the Power fix on hugepd putting this aside. I hope that before the end of this year, whatever I'll fix can go away, by removing hugepd completely from Linux. For now that may or may not be as smooth, so we'd better still fix it. -- Peter Xu _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel