From patchwork Fri Jun 9 01:23:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hugh Dickins X-Patchwork-Id: 13273076 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 4B40BC7EE25 for ; Fri, 9 Jun 2023 01:23:27 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E277F8E0002; Thu, 8 Jun 2023 21:23:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DD6D38E0001; Thu, 8 Jun 2023 21:23:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C9FB88E0002; Thu, 8 Jun 2023 21:23:26 -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 BC55E8E0001 for ; Thu, 8 Jun 2023 21:23:26 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 93BD4C0329 for ; Fri, 9 Jun 2023 01:23:26 +0000 (UTC) X-FDA: 80881461612.22.BFC3234 Received: from mail-yw1-f169.google.com (mail-yw1-f169.google.com [209.85.128.169]) by imf28.hostedemail.com (Postfix) with ESMTP id C1474C0009 for ; Fri, 9 Jun 2023 01:23:24 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=google.com header.s=20221208 header.b=PhwpDxcj; spf=pass (imf28.hostedemail.com: domain of hughd@google.com designates 209.85.128.169 as permitted sender) smtp.mailfrom=hughd@google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1686273804; a=rsa-sha256; cv=none; b=MLkNXGSWSBSREvOW6Vztx8Umz5DmvYDw39pv1sAgWQ3ZsVLthPunXCEI7ylaDkxVPWdaY1 FSZayv5zEdU9I2q3fGiUgewTezXvZCJEyxPVOiI4dtyj7dkg/Gv5zhdqzE7gwvBs9IhMp7 OxSTkW9yxMp/uohsgH5Y4Xnkup+hpPc= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=google.com header.s=20221208 header.b=PhwpDxcj; spf=pass (imf28.hostedemail.com: domain of hughd@google.com designates 209.85.128.169 as permitted sender) smtp.mailfrom=hughd@google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1686273804; 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-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=3KTDoQQSpcjB9NQiyOQFUXOX88v07BrrKabYvpMIx6w=; b=IivBxkyRlenqAEwhwhwBpcqG75sPh1ouaRny82bbueyd3U5gbtZ+s1Y4vvw0SAC7T7sbAo Vc3/bhTPbnXqHVmawes7cuScxg6OVyFeMFCC2txm8hnQHw6pXVIWhXlNESgtORGMNz0/aF MOb5KIJDq8awkAmXSZF34Psr/CJMYnY= Received: by mail-yw1-f169.google.com with SMTP id 00721157ae682-565cd2fc9acso11719677b3.0 for ; Thu, 08 Jun 2023 18:23:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1686273804; x=1688865804; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to; bh=3KTDoQQSpcjB9NQiyOQFUXOX88v07BrrKabYvpMIx6w=; b=PhwpDxcjLXiR7MGVaWKfABLE3dmRB3qka2k6U1l+muDGzWLhomU4qiQ57KmT6VH8qY ACB3DayhC4faseiipd0QCNLUtNtuFH3XTvyWMyC+FvmNiYj2hTBmc8pdfyd4XFmOfbWU tZooxmyCXH+STIuVMaRhFjnJtSpEto0Mxch6xRdf+bo4VO2G6a/c8gheC2mOEmzSx5zk ccYQOeUWSm1v0s9lMRW9nRmwt5CbXGDSvPCaqv/QLtUPzWt0If7EQ4o8TmUAMcKVROe3 I5HEpFf63MgdvN7DdkYJ8qdg2z230og4tgBl+c7UnWgkZm/cRQnWkzi++q5rmkDVXcaG 0vug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686273804; x=1688865804; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=3KTDoQQSpcjB9NQiyOQFUXOX88v07BrrKabYvpMIx6w=; b=YPVBFHf3ywBIsprmSpTbM2Im41Wbos5Hrl+Hb/joLksfRTL5faKEWQRMJGqWVLsl7h jNsxMRukQ9E9bj6vYxwLOmrhHCVtIGnurxVjedlUzmbgn2noLAss0ajjmYIU1jv2cLSW b13HfyqIcOPCS36hTmGcxrU1xw2khIqBxPYLkvJ9vg1w+r/UrwB1/aQP89zMqHpENlw+ vuXq0nmduoJK7cyi86r2iVIEvhyjGai8126OctU69Jdo2rlFxxMWRYBmZNgDcykFmAO3 DGvTxdystqnfXxJic/QIV1cipWpWapxHkqBDGXcgU8hdLVnjPLydJ+8gxrdeNoCXnQ8u 0jYA== X-Gm-Message-State: AC+VfDwyKGTXFKO8J3lo5Y7sAO1lUNmd/MsN2OvqgYtw3O2IiBikYzFg cA9vVQ0635szPWbpnWmTry/swQ== X-Google-Smtp-Source: ACHHUZ5Qxg9qOQctVm9TDBIrvRBwWLkj4+fag3kdEXz2orEpq2AOsjXF+B86JD9LcmOUKUNihoCjxw== X-Received: by 2002:a81:6743:0:b0:568:f9f0:b057 with SMTP id b64-20020a816743000000b00568f9f0b057mr1198700ywc.26.1686273803806; Thu, 08 Jun 2023 18:23:23 -0700 (PDT) Received: from ripple.attlocal.net (172-10-233-147.lightspeed.sntcca.sbcglobal.net. [172.10.233.147]) by smtp.gmail.com with ESMTPSA id i11-20020a0ddf0b000000b00568ab5dd873sm288724ywe.65.2023.06.08.18.23.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Jun 2023 18:23:23 -0700 (PDT) Date: Thu, 8 Jun 2023 18:23:19 -0700 (PDT) From: Hugh Dickins X-X-Sender: hugh@ripple.attlocal.net To: Andrew Morton cc: Mike Kravetz , Mike Rapoport , "Kirill A. Shutemov" , Matthew Wilcox , David Hildenbrand , Suren Baghdasaryan , Qi Zheng , Yang Shi , Mel Gorman , Peter Xu , Peter Zijlstra , Will Deacon , Yu Zhao , Alistair Popple , Ralph Campbell , Ira Weiny , Steven Price , SeongJae Park , Lorenzo Stoakes , Huang Ying , Naoya Horiguchi , Christophe Leroy , Zack Rusin , Jason Gunthorpe , Axel Rasmussen , Anshuman Khandual , Pasha Tatashin , Miaohe Lin , Minchan Kim , Christoph Hellwig , Song Liu , Thomas Hellstrom , Ryan Roberts , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH v2 13/32] mm/hmm: retry if pte_offset_map() fails In-Reply-To: Message-ID: References: MIME-Version: 1.0 X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: C1474C0009 X-Stat-Signature: pmgad7hoq4wbcez4ydenxik164xa1jua X-Rspam-User: X-HE-Tag: 1686273804-326053 X-HE-Meta: U2FsdGVkX19AQ5WNFe1PSDOkSKGNAVeIjH9Ssoo13Is64gQJ7jNMqMCKNWWc+NgADf73ZOD5syCXB168sam21ruqztocxc4+nf7ZPBSNjDekCibC4NexHYFpQHKFhEk8styCjev5SAM2Q6b6Xua3BJeJDSXyqdVmQxtNJTgnPJDRexUkJN12Ugtj+/GNGVult/U6hDzSybldeKN8Uwo55+Wrd53Qld+C1D6syc8UHLvvUCQ4rmq7IDV+XWBL4IKP4PBDrs39NTLW+p3oCm5zNG0nC4q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mKxZhSmRCTEgJiFiFXM3+B9CRTfpLbGIjlWflC+U4+llmB6D8WPm6aWYqoLdShDO2dO2NwGgySQrFH/5XjzbZwhDO2v5QH0SFs/O84= 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: hmm_vma_walk_pmd() is called through mm_walk, but already has a goto again loop of its own, so take part in that if pte_offset_map() fails. Signed-off-by: Hugh Dickins Reviewed-by: Alistair Popple --- mm/hmm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mm/hmm.c b/mm/hmm.c index e23043345615..b1a9159d7c92 100644 --- a/mm/hmm.c +++ b/mm/hmm.c @@ -381,6 +381,8 @@ static int hmm_vma_walk_pmd(pmd_t *pmdp, } ptep = pte_offset_map(pmdp, addr); + if (!ptep) + goto again; for (; addr < end; addr += PAGE_SIZE, ptep++, hmm_pfns++) { int r;