From patchwork Mon Mar 25 22:33:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vishal Moola X-Patchwork-Id: 13603121 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 28824C54E58 for ; Mon, 25 Mar 2024 22:33:58 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BA9596B0088; Mon, 25 Mar 2024 18:33:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B059E6B0089; Mon, 25 Mar 2024 18:33:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 957F16B008A; Mon, 25 Mar 2024 18:33:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 80D7A6B0088 for ; Mon, 25 Mar 2024 18:33:49 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 4A31580842 for ; Mon, 25 Mar 2024 22:33:49 +0000 (UTC) X-FDA: 81937014978.02.B9E99C8 Received: from mail-pj1-f51.google.com (mail-pj1-f51.google.com [209.85.216.51]) by imf15.hostedemail.com (Postfix) with ESMTP id 74EB7A0013 for ; Mon, 25 Mar 2024 22:33:47 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=MYRAprQA; spf=pass (imf15.hostedemail.com: domain of vishal.moola@gmail.com designates 209.85.216.51 as permitted sender) smtp.mailfrom=vishal.moola@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1711406027; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=BlCoIx7jLqN5Is/HEKy53SFm13f31lm8FF5rHEKGzHA=; b=sPPLP3zuvap2bL9sjbTEArdwSr3kmUd1aC/4ubxWbuTcPn/M0lskF8T7TOCRDt3WK6VKCs oolrTUMjx1EL61WQxOJAsQGZVSVqPaVl2vUFBtxIUbJrILZolkEUV0X5JdkG1fKOKOg/kC jgz/oE/x9TJGswqmzU75klP1AU2CSY0= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=MYRAprQA; spf=pass (imf15.hostedemail.com: domain of vishal.moola@gmail.com designates 209.85.216.51 as permitted sender) smtp.mailfrom=vishal.moola@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1711406027; a=rsa-sha256; cv=none; b=o0WXd1XgRGqCqH8arpbRKkDwQrUS3uaNXk1YMCJqUFjGJdVUOx97VAtcpeYAnoXNVVvaMZ JaWxrinBZjtmh+hpk3GYyYLDejjAEHiQeSx3PeqHAi3jz2Rkhb7NAINQm3Uh2pes4CXo7m Euyt6D07FBkVwBO2OsYdbHGnPTfsO5U= Received: by mail-pj1-f51.google.com with SMTP id 98e67ed59e1d1-29de4e12d12so3408308a91.3 for ; Mon, 25 Mar 2024 15:33:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711406026; x=1712010826; darn=kvack.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=BlCoIx7jLqN5Is/HEKy53SFm13f31lm8FF5rHEKGzHA=; b=MYRAprQAtL/RQfaKTB+aCxEO8OAKD07VKFm8g1wOXV/fPAcQBw8azuJvqAh7pYkaUU pBJ6oxtaxQjShCPMJF7S1k9QTRSt3xPzC7LrTmB5pWyT9IHvLRVzSsAO36DhS+1JBwQs Jus/aGIS8BhUXvX1XmMLBPM0yznPCQ+xSPd9S0GOgFFKL5xq1Ka1KAUgCAKHscjSfx4F nRt98+ryTzrvvHXcJ+kK2N5uXajIGWBdl3eCsDqdFJ8L0UjajUAtlco3Jw5gJRtsIcRJ ifB+guCPy+6t68pDKQlFihc1xfPG6ChUByQsZt2tMr3YEeis+w+9ei1zHvfy985NFyGd 8Gig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711406026; x=1712010826; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BlCoIx7jLqN5Is/HEKy53SFm13f31lm8FF5rHEKGzHA=; b=vVbU6vYtCsSmlRvGmJPnSXgu/pAmG4BPveqf+pDJ2qHzSajJlF9aeaCf9CR62jpqry 7zt/nh9dhLOK1avMjeE772xVSeoWZtcvH7/BJI98CRIH2g7WvIpHaW6zSLh8RDQpC2KD o+WGZm7GnyIDxPI/OynVTA6e6fx42ezAqGvUQcSHu5b/dpSMia67xPDeV9gD3NAK+rUL GAh4UFG9WjAAnL9Wzbs31T+VcwGv7gC8lfvCfbnGZaaeH24loQAg4KDWQCZFalCik4Zy OHeNlps/yrOjjnUgNciZxodxusv/ruspFJK3+LyQew3GXXW8ijNGMIAdKv59TdAgf2ah Q9dw== X-Gm-Message-State: AOJu0YxvOOIw1COjvlS0CzKFHePMuVXE6ll8s/8OL0ElQoek77pRvaZL U5XyN9ZUVLQ/spNOqEacedI9xAOXw2TNLF1fCw9HC/AEBaJLGkMuBd8q4BOj+eo= X-Google-Smtp-Source: AGHT+IHqkDjxiCBXirJRGAONJPRKYdtlto3CBeWqAPDu5xBIWL2dfiUZrx6HsrjVwyLsjkfUNcQ0aQ== X-Received: by 2002:a17:90b:f08:b0:29b:c2b3:2712 with SMTP id br8-20020a17090b0f0800b0029bc2b32712mr6441165pjb.26.1711406026161; Mon, 25 Mar 2024 15:33:46 -0700 (PDT) Received: from fedora.. (c-73-170-51-167.hsd1.ca.comcast.net. [73.170.51.167]) by smtp.googlemail.com with ESMTPSA id sx16-20020a17090b2cd000b002a053cdd4e5sm4356173pjb.9.2024.03.25.15.33.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 15:33:45 -0700 (PDT) From: "Vishal Moola (Oracle)" To: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, akpm@linux-foundation.org, muchun.song@linux.dev, "Vishal Moola (Oracle)" Subject: [PATCH 4/5] mm: Make pgoff non-const in struct vm_fault Date: Mon, 25 Mar 2024 15:33:38 -0700 Message-ID: <20240325223339.169350-5-vishal.moola@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240325223339.169350-1-vishal.moola@gmail.com> References: <20240325223339.169350-1-vishal.moola@gmail.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: 74EB7A0013 X-Rspam-User: X-Stat-Signature: 8yw397opzru5bkq46i7qadx3tj7h6wza X-Rspamd-Server: rspam01 X-HE-Tag: 1711406027-129043 X-HE-Meta: U2FsdGVkX1/aEQasnDP1uYWf1yw+LBQALtN/Ax9YDKt+57MMttx1AHvj75JRjZTA7vpawaGI1OepKBj5OEJGXgCstCUruwAC/Iq4FF7oyO0Oebf09qf3DF9rzSSS8ADQzM3Qw0bCRMYin1ggK264QS2GltCAM4iOgSD5njMloAYy3sN04gQ7fpSo5mMQJ1dNiOCWtWrsvTG4VA/bmQAxx4p89OErgj/Cffjqb78o8464row9vwzZI/s/+mGKmyWB13SBvOf7l9SUOiZy6hSmOV1NI8GRkJ9gx6K2HH1W+qOrYbfhjAtNH6R535MSW09gH2/j5FEDU8RHfTpgOLd+YwSjArXedW4DrHmFdqxKHSQqRg9IDzdlnZ9L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jm1Du7e3D2SQ3g9WvAcafwCwwH/xxGsB7jkwgwQaqIVC7PqOa+p5AP4zQ5Aa94HGpalIVPgIoCyvEC5LNv36UNhXs4lWdQg9HbvuV7LGFhIk/+MB/Luiu7l1yDp1os0m5Lq3EC18qoBJtw== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Hugetlb calculates addresses and page offsets differently from the rest of mm. In order to pass struct vm_fault through the fault pathway we will let hugetlb_fault() and __handle_mm_fault() set those variables themselves instead. Signed-off-by: Vishal Moola (Oracle) --- include/linux/mm.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index f5a97dec5169..c6874aa7b7f0 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -507,10 +507,11 @@ struct vm_fault { const struct { struct vm_area_struct *vma; /* Target VMA */ gfp_t gfp_mask; /* gfp mask to be used for allocations */ - pgoff_t pgoff; /* Logical page offset based on vma */ - unsigned long address; /* Faulting virtual address - masked */ unsigned long real_address; /* Faulting virtual address - unmasked */ }; + unsigned long address; /* Faulting virtual address - masked */ + pgoff_t pgoff; /* Logical page offset based on vma */ + enum fault_flag flags; /* FAULT_FLAG_xxx flags * XXX: should really be 'const' */ pmd_t *pmd; /* Pointer to pmd entry matching