From patchwork Thu Jul 18 21:26:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 13736735 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 98837C3DA49 for ; Thu, 18 Jul 2024 21:26:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D9E626B0083; Thu, 18 Jul 2024 17:26:27 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D81A66B0088; Thu, 18 Jul 2024 17:26:27 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BA1956B0089; Thu, 18 Jul 2024 17:26:27 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 9B4516B0083 for ; Thu, 18 Jul 2024 17:26:27 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 51106C0245 for ; Thu, 18 Jul 2024 21:26:27 +0000 (UTC) X-FDA: 82354157214.14.1D02FC9 Received: from mail-yb1-f177.google.com (mail-yb1-f177.google.com [209.85.219.177]) by imf01.hostedemail.com (Postfix) with ESMTP id 834134002B for ; Thu, 18 Jul 2024 21:26:25 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=toxicpanda-com.20230601.gappssmtp.com header.s=20230601 header.b=chDaZlN1; spf=none (imf01.hostedemail.com: domain of josef@toxicpanda.com has no SPF policy when checking 209.85.219.177) smtp.mailfrom=josef@toxicpanda.com; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1721337953; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=v7PBVSx5ziDZwaVY9t5GrY4NmBJYpcAQRHUzVDOo2BU=; b=piQOuOC6t4JnhudXA8S+js1IsObK5OankZnAiZ0AxV7t3VMQN6Uz/kC4QxoBh+gWbGpoT2 uib77TlLTGBUqdSTy0gJULwHXrxMB9MMJGuG3h/qhPQ0AA+vPjeRdybYOmUtyZ2g89Ruvu aFS3KdSX1bqnXjEkPYj4GPQbUglByMY= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=toxicpanda-com.20230601.gappssmtp.com header.s=20230601 header.b=chDaZlN1; spf=none (imf01.hostedemail.com: domain of josef@toxicpanda.com has no SPF policy when checking 209.85.219.177) smtp.mailfrom=josef@toxicpanda.com; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1721337953; a=rsa-sha256; cv=none; b=gyYuyFhRrVJ+SO7pZs8akZ9p7kAVDRVTWtNyVISsxKJA11cZM53MXMVJU0mhjjtenzOtuP z4ZsVYyDibq1OI3ViHkdEEXagI2ziiwXBaomG7QsI8H7M4RU+SXFGj4qfg0Vd4/h222WZJ gOZCoPh9wMkobF4Ka0BBooDHnGlfgFQ= Received: by mail-yb1-f177.google.com with SMTP id 3f1490d57ef6-dfdb6122992so1153658276.3 for ; Thu, 18 Jul 2024 14:26:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toxicpanda-com.20230601.gappssmtp.com; s=20230601; t=1721337984; x=1721942784; darn=kvack.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=v7PBVSx5ziDZwaVY9t5GrY4NmBJYpcAQRHUzVDOo2BU=; b=chDaZlN1Ox9O75jZYMIExT0PaxY5+VAVdA6Akbld3oz2iQnQ6t2QUwaO31iht5grJ7 KmpsQVv4D1HA3AmLKo1VXMskLuZ84Y1uXWHOgy15aFbIpcqHsGIBExd1ssNbeJvn4Gsf 5DmbwzPAEfWPsd0j0mqZyuLX38KCxLQLG7QQekKG0FzdnIsAH04hnWdbuiFj/mlRFrp6 xHzRiDGc4KtCH975EKpQgpQOG0oSMZx+W8YP515e+4P/NoIezn7tzGtpmXcxhr+MwpmL I6rNsKNtOCuLBaRFblyQ+riX5+Af2WuDYOij59+iKe9FEH1VjDgCukMAzxFpa0kPBRu9 DmTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721337984; x=1721942784; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=v7PBVSx5ziDZwaVY9t5GrY4NmBJYpcAQRHUzVDOo2BU=; b=WoGMU2HcYu6OvLaNhUJ5YIUG5t6pI0q23crDUAHIvq9U8/XhiQGFWy5e66OXneOqb9 ac4ZbBnpgbTMH03Eg382uZQU0eJM/C/KtZBvdESMlixmDwvs0excTOTdQqXSwqs8AB5Y poD3KpKQiXCtlYnqrcLovm4nyovEg28wSDON3dEPhWrtSqye9ZHdHaMyamGUHlrZlpfS PWeixuqrHKYdP5IpTkjgf/WlILP2ErutDwlFnKik4D1FQeVYiWwkoeLD6Vjfe8KHzXRH oNUfz6hG56c9DHK9Ek75Aawh6n7196sN8zTKXnQWPxD2ArJST+lxBtgEqjoaJJt4eodG oshg== X-Forwarded-Encrypted: i=1; AJvYcCWNbiR664xnfb1vWSHMFkN7OvBb/Iv72NUKvaWOIh4AYX6da5J007N5WP4876q+qUrc+mHWEU/swfTMX5gFGo8wugA= X-Gm-Message-State: AOJu0Yxc2ZexvVMuimymAEOOY/1BaZS2BhRkOR4qwcvms75ZPcoLjHnM T34augMpiqNHwQI4h/q5Z0SkC0vXSyFY2pT0vbf+F2XPse7BQwz3us76tLNFBWGZ3644zd3y6JB s X-Google-Smtp-Source: AGHT+IEnhJ0CLvoaY+kk8HWf+SUqKrEaAogw+0SymN/AiUjlOYsjPJzFv/oxl0O4Yz2SiQIP4/3GZA== X-Received: by 2002:a05:6902:1603:b0:e03:aa52:d804 with SMTP id 3f1490d57ef6-e0640dbf6dfmr4109342276.29.1721337984531; Thu, 18 Jul 2024 14:26:24 -0700 (PDT) Received: from localhost (syn-076-182-020-124.res.spectrum.com. [76.182.20.124]) by smtp.gmail.com with ESMTPSA id 3f1490d57ef6-e08609f4afbsm23174276.32.2024.07.18.14.26.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jul 2024 14:26:24 -0700 (PDT) From: Josef Bacik To: akpm@linux-foundation.org, linux-mm@kvack.org, kernel-team@fb.com Subject: [PATCH 2/2] mm: remove foll_flags in __get_user_pages Date: Thu, 18 Jul 2024 17:26:07 -0400 Message-ID: <1e79b84bd30287cc9847f2aeb002374e6e60a10f.1721337845.git.josef@toxicpanda.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 X-Stat-Signature: 9mu1odud1k33hkan9dozsfcc8xkdnur6 X-Rspam-User: X-Rspamd-Queue-Id: 834134002B X-Rspamd-Server: rspam02 X-HE-Tag: 1721337985-157332 X-HE-Meta: U2FsdGVkX193soWAVO6nSESUyMYd3gYp7XoQ4olFjFGx2DC1G+F1VKy5p+e9IZKXcfXbDa6mFNwAYU3psK6AVizLXv9vCBECBgqvSrrQshEGvnCRQ8vF+5ScbmXK3E61IZ1ZmBjJjaRsGURUdbjW4ug4bz1YzSJdOkcEHzu0xiwabJoNO075Moja39VQca8Io5UiLiNfT0N3HlWogVKWax3iLWn4FhYMEVSqjZ+gYu5LEWikbq1H3raGhBRhjwfJB+2i7fF09+iQ30ze0xyicdI3C0MtKGQh17t5ZMZ4EOlqvksRo9aZfLdrojCiEyjy4mRErIuHjq/Gu/QPx5QvccBkflaEhYmF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1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Now that we're not passing around a pointer to the flags, there's no reason to have an extra variable for the gup_flags, simply pass the gup_flags directly everywhere. Signed-off-by: Josef Bacik Acked-by: David Hildenbrand --- mm/gup.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/mm/gup.c b/mm/gup.c index 985d5141592f..120740cf5a34 100644 --- a/mm/gup.c +++ b/mm/gup.c @@ -1437,7 +1437,6 @@ static long __get_user_pages(struct mm_struct *mm, do { struct page *page; - unsigned int foll_flags = gup_flags; unsigned int page_increm; /* first iteration or cross vma bound */ @@ -1488,9 +1487,9 @@ static long __get_user_pages(struct mm_struct *mm, } cond_resched(); - page = follow_page_mask(vma, start, foll_flags, &ctx); + page = follow_page_mask(vma, start, gup_flags, &ctx); if (!page || PTR_ERR(page) == -EMLINK) { - ret = faultin_page(vma, start, foll_flags, + ret = faultin_page(vma, start, gup_flags, PTR_ERR(page) == -EMLINK, locked); switch (ret) { case 0: @@ -1547,13 +1546,12 @@ static long __get_user_pages(struct mm_struct *mm, * large folio, this should never fail. */ if (try_grab_folio(folio, page_increm - 1, - foll_flags)) { + gup_flags)) { /* * Release the 1st page ref if the * folio is problematic, fail hard. */ - gup_put_folio(folio, 1, - foll_flags); + gup_put_folio(folio, 1, gup_flags); ret = -EFAULT; goto out; }