Received: by 2002:a05:7412:7c14:b0:fa:6e18:a558 with SMTP id ii20csp536rdb; Sun, 21 Jan 2024 14:32:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IFuG1JsGl5TIupDqtCH5vwoWa8DcZh1DZnoahOjucgISOwZ/H3WPcDSFhDT1aKmJcfN1Y0p X-Received: by 2002:a17:902:a616:b0:1d7:199:cfb4 with SMTP id u22-20020a170902a61600b001d70199cfb4mr3352519plq.54.1705876346672; Sun, 21 Jan 2024 14:32:26 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705876346; cv=pass; d=google.com; s=arc-20160816; b=cp2Qou1g/0tAL3DgE+vnZf5mFj0Vluz1m/vKjVv5n8ICvHQSBEvzTysH2T97DvFtPC bxmS8VZXm5GugsBv/vaicMWOO68LMbhFAO/Na/3tEJVO0cQYC/SX4YL1VotkJ3qCAgcN 95mlYNPvY34DgQptsAP/NFyx84jLA+BA9Mi3U8+ISrjYyfTfiY/VAZjuJ+F9vK2OVWBK MCePqQvj7LwT7zkTiJs5ddVeo+XdODtM7BGzyJmz/B4dvsk52UpN/AkTv4lvbP8ErWCb xkEriVfFHs3IBJANKWHL9IOYSN5nmQFnWlTrMMJm75C4kRPD0Aa0tBCfTzWgCiJQtMuM mzhA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=1q4Dz/6Czk2Moun0gtKGmvtxSBRjtHShkg+G+N3aeRQ=; fh=ExYQWocjXvlmiqEbNmhtN6sPttmUsTCq9sX743KR7iQ=; b=gEbDkUex3lKRXt0naqwmLZRPzd5JbyYXlID5+OWG7iRV5JgUC32HT2juZ4UD9DfbLj ZPCasOkw6SRshPi79IeIuUFqGvxdLVHYTvjcGrIrzAddUecWwjIEmr1CXKTx8YPbhT8u ZmWI9JTRgvqds2BP+F2MQ70v9H5NXKOmJCOT8oC3wqHnKvaVUt5UXoh5j+Gi6DETr+vY e7RU9k1Lq3HxtHMvsv8eFAg5UOyynfD/MBgbaKyr2yZcjG1W2pspDg6CCgDALtrMUqke /1+oX7iQYZzFrToo4Sf5MMauHFm9wgcF/DVoybzWTG9QDsko1P/DfONj3qMbAekR0ZxG dYhw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=IcWnR77v; arc=pass (i=1 dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-32209-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-32209-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id k2-20020a170902e90200b001d4e7adff19si6991895pld.596.2024.01.21.14.32.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Jan 2024 14:32:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-32209-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=IcWnR77v; arc=pass (i=1 dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-32209-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-32209-linux.lists.archive=gmail.com@vger.kernel.org" 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 690DAB212AC for ; Sun, 21 Jan 2024 22:32:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D316538FB3; Sun, 21 Jan 2024 22:32:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="IcWnR77v" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 0D40438F8F for ; Sun, 21 Jan 2024 22:32:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705876331; cv=none; b=oM6mPrDbD/XKnpJmXp0vsleBtSa+mT/3F3oU7Oa/vdtJ+gwNB3st7kYs2pqB+8phMQ1JFsHhJ7r0Q2MGjLWM2psHiMHSGPq9xg4FeiZZ9aev+rtaC3k+c5r7CmfQzkItv3/E1VUeVkvSsCX1hPuNNiouNqAesl+V82H+ZGRdAFI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705876331; c=relaxed/simple; bh=9k4gLXrDoUW9Co+CJ49bJ3hXohkNEukZ+y/yeMXY7Xs=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=ITyB09PPKd2irTMJrvblGXyhNa54N8CPSwZcFcHv1DGD4zgJySLVV1ZwuWcDR+ZXqzW+ezz5vVYfnrV9A1nmFYghoh2uwN/YQc5TGXcX5OK0YVuo0X/1ERUGVafmNdkyYIU12Dp8J/YzHWI0qclaMkTFab2iOursJ4b1y522Zho= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=IcWnR77v; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6B941C433C7; Sun, 21 Jan 2024 22:32:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1705876330; bh=9k4gLXrDoUW9Co+CJ49bJ3hXohkNEukZ+y/yeMXY7Xs=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=IcWnR77vCDQ5A61TLKtCNAVCZB7jbpvXZ+8G6QaOMzO5QKTWK6akbiQRv3egGutQU /9hyKuUu1s57DZXH+BA+kg/WfrUiOCpQnbYohzuCW7iyfDgLLNrIr620fHGaONIh8a n57yTFoGWM57hiZ3Jq6VmiYQYMTTiZhqWoohDzNg= Date: Sun, 21 Jan 2024 14:32:07 -0800 From: Andrew Morton To: Prakash Sangappa Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, muchun.song@linux.dev, mike.kravetz@oracle.com Subject: Re: [PATCH] Hugetlb pages should not be reserved by shmat() if SHM_NORESERVE Message-Id: <20240121143207.299f0d3df52ac746224dacd8@linux-foundation.org> In-Reply-To: <1705713472-3537-1-git-send-email-prakash.sangappa@oracle.com> References: <1705713472-3537-1-git-send-email-prakash.sangappa@oracle.com> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Fri, 19 Jan 2024 17:17:52 -0800 Prakash Sangappa wrote: > For shared memory of type SHM_HUGETLB, hugetlb pages are reserved in > shmget() call. If SHM_NORESERVE flags is specified then the hugetlb > pages are not reserved. However when the shared memory is attached > with the shmat() call the hugetlb pages are getting reserved incorrectly > for SHM_HUGETLB shared memory created with SHM_NORESERVE. > > Ensure that the hugetlb pages are no reserved for SHM_HUGETLB shared > memory in the shmat() call. Thanks. What are the userspace-visible effects of this change? Based on that, is a -stable backport desirable? And can we please identify a suitable Fixes: target for this?