Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp586388rwb; Thu, 27 Jul 2023 18:26:31 -0700 (PDT) X-Google-Smtp-Source: APBJJlFPPSQmbAaRxec9n92dEFfwXtD7n3avbzrPyXaxKbEWROXd+shB0jMMLa7iRXnkUjfKlHBV X-Received: by 2002:a9d:67d8:0:b0:6b7:518a:1672 with SMTP id c24-20020a9d67d8000000b006b7518a1672mr907079otn.34.1690507591266; Thu, 27 Jul 2023 18:26:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690507591; cv=none; d=google.com; s=arc-20160816; b=l1x+KrBuJu97f9OkNgYvhXbUczneT/TzI8gJTSisYRSSnmCXoi+pJ1Bfau7Q4yudU6 Xazrgk1lVl1doVf5HSEIbQtIe3LS33zJ3tXTji8wxLdetsJjhVCCO+I7thIx5JbVh3nc cLCdGWPL+PUhQrNCo0KO36YhxtPst82FPHhKmu+B2mH1xGur84B1hwdCq3kb41gDY5/C l3jqqbYPwbiqRhtTU2BITW4Ai0lT2mpzBUlSaPMzTqkNz+D1J/FJFZ2tPj1vbe3w1Qa+ c47NNBZ8hAzaYg1BZnLsgftPyqfCXoCBD+cWfmJPxIET/lafIILPKUK91IvE+Jt11jJI ySDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=v+3mghGdDw3pgWEcgcYoEfWjzZksiK+Y0jeaZ0QzAOU=; fh=b8VE58lGapXwGnA042yFazckc9lg+tKj6+yc0BVpG1c=; b=resofIhs3OHRNX8+ZL/AQ+LoYd50CvaxwHknYZKsFQqbx85pbR6ngSsZGrljSWp3lX xW2EsrlLuSbqUzGa3xkcZUY7EvbwP3U9XyZPd2WqU5bxFUK/9WilRF/UmX7DSx/m4/AS uNISzkzBGoSGvV3vjFpWSXSqGFMZDAEKqOKiM3tl+E5WYAqeHND5Deq2XpAPwsZHsMom iPVVVH70dWDVR40N0YuDis36Y/vRgww8804Ocn/RK3IECPaFQnyJ9Pwj629dTZf0Ey9V dQvNA73TabPDm466DIt4pPK+RiTI4lv2liFomhk05xTi/Yybfc4oXlLif1WrpQJxSIyC oiPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=QlXDG7dO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 16-20020a631650000000b00563b0cbe820si1996402pgw.688.2023.07.27.18.26.19; Thu, 27 Jul 2023 18:26:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=QlXDG7dO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229568AbjG0Xkg (ORCPT + 99 others); Thu, 27 Jul 2023 19:40:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40764 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229448AbjG0Xkf (ORCPT ); Thu, 27 Jul 2023 19:40:35 -0400 Received: from mail-yw1-x1135.google.com (mail-yw1-x1135.google.com [IPv6:2607:f8b0:4864:20::1135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5ACFC2D71 for ; Thu, 27 Jul 2023 16:40:34 -0700 (PDT) Received: by mail-yw1-x1135.google.com with SMTP id 00721157ae682-57a6df91b1eso16784857b3.1 for ; Thu, 27 Jul 2023 16:40:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1690501233; x=1691106033; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=v+3mghGdDw3pgWEcgcYoEfWjzZksiK+Y0jeaZ0QzAOU=; b=QlXDG7dOBbLTmKZXaDqqSHenhyN0unre9JC8EHuL2yEH17R7suvTwuIiXmH3KhoA3F gUo0c/MCiieFd/uG/4EyLTRQ9WWcTwP/Tybc9KzazFt8eUIivVVTo9sXKwMajz4IrvbH +jY9dHOXEx/wj9EsGakkGmOMSqxsC9ALJ0S4N7TXgUQI0J/0m7MIEaP7F2lY6vvGzCZr 4DA7k4GNtlqpK+8p3ADoXpMP6Dzqy3FVCYiHvOcsLy1mKty28PtFy8SneHRLScNS1fwc LjGkuTBhiiMImZjg8OXPVxEWY7jq3QYoxEec/UIBAblxtwcjs7/IaVkd9CBtN5qsbzKj hG6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690501233; x=1691106033; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=v+3mghGdDw3pgWEcgcYoEfWjzZksiK+Y0jeaZ0QzAOU=; b=RCK8lRv/LbOAWUfqJJ5T8+eJxnISTYyTEt4UC/BhJYuXC05r6tnEM+65aEQER1MRPP 6q66PALozsM7C3hwCMHpDuc1h/LNdgFUO4f16fVbDgYDyvL48qXdgh1DBVQKMgd9IjfL YgW2dmyD5bEwlyIpRqIjxstiyQBAScHcl/WqUHh+IS/UhR7XRFaRrZSXcijYeMdC+Gqo LJL+I1TeLji5/HHNNz7e83L9JX54oYZ0isTBTH4qF6xfKpnlRIzrWPEc1BgXH5giXkOW ioJH+sAG2bxoK7nRBWx5xVWSW10+YrGxlYIFFKFRRuuPppifUtcWw6Xn1MmTzvOic4J6 41xw== X-Gm-Message-State: ABy/qLYtlRAt1boDQEQPUiuiI43ERZqLoSgxrvhg2Ag7BGl2ve4MXlyr //wkya4Huq8qxd8oLs0tGLvNqgvFnJCNK0cJ7iB6BIeXTMNctQV6zFVukw== X-Received: by 2002:a81:460b:0:b0:577:3666:bb4e with SMTP id t11-20020a81460b000000b005773666bb4emr99433ywa.36.1690501233367; Thu, 27 Jul 2023 16:40:33 -0700 (PDT) MIME-Version: 1.0 References: <20230728091849.7f32259d@canb.auug.org.au> <20230728092915.732d4115@canb.auug.org.au> In-Reply-To: <20230728092915.732d4115@canb.auug.org.au> From: Suren Baghdasaryan Date: Thu, 27 Jul 2023 16:40:20 -0700 Message-ID: Subject: Re: linux-next: manual merge of the mm tree with Linus' tree To: Stephen Rothwell Cc: Andrew Morton , Jann Horn , Linus Torvalds , Linux Kernel Mailing List , Linux Next Mailing List , "Matthew Wilcox (Oracle)" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 27, 2023 at 4:29=E2=80=AFPM Stephen Rothwell wrote: > > Hi all, > > On Fri, 28 Jul 2023 09:18:49 +1000 Stephen Rothwell wrote: > > > > Today's linux-next merge of the mm tree got a conflict in: > > > > mm/memory.c > > > > between commit: > > > > 657b5146955e ("mm: lock_vma_under_rcu() must check vma->anon_vma unde= r vma lock") > > > > from Linus' tree and commits: > > > > 69f6bbd1317f ("mm: handle userfaults under VMA lock") > > a3bdf38e85aa ("mm: allow per-VMA locks on file-backed VMAs") > > > > from the mm tree. > > > > I fixed it up (I think, please check - see below) and can carry the fix > > as necessary. This is now fixed as far as linux-next is concerned, but > > any non trivial conflicts should be mentioned to your upstream > > maintainer when your tree is submitted for merging. You may also want > > to consider cooperating with the maintainer of the conflicting tree to > > minimise any particularly complex conflicts. > > > > -- > > Cheers, > > Stephen Rothwell > > > > diff --cc mm/memory.c > > index ca632b58f792,271982fab2b8..000000000000 > > --- a/mm/memory.c > > +++ b/mm/memory.c > > @@@ -5392,32 -5597,18 +5597,21 @@@ retry > > if (!vma) > > goto inval; > > > > - /* Only anonymous and tcp vmas are supported for now */ > > - if (!vma_is_anonymous(vma) && !vma_is_tcp(vma)) > > - /* find_mergeable_anon_vma uses adjacent vmas which are not locke= d */ > > - if (vma_is_anonymous(vma) && !vma->anon_vma) > > -- goto inval; > > -- > > if (!vma_start_read(vma)) > > goto inval; > > > > + /* > > + * find_mergeable_anon_vma uses adjacent vmas which are not locke= d. > > + * This check must happen after vma_start_read(); otherwise, a > > + * concurrent mremap() with MREMAP_DONTUNMAP could dissociate the= VMA > > + * from its anon_vma. > > + */ > > - if (unlikely(!vma->anon_vma && !vma_is_tcp(vma))) > > - goto inval_end_read; > > - > > - /* > > - * Due to the possibility of userfault handler dropping mmap_lock= , avoid > > - * it for now and fall back to page fault handling under mmap_loc= k. > > - */ > > - if (userfaultfd_armed(vma)) > > ++ if (unlikely(vma_is_anonymous(vma) && !vma_is_tcp(vma))) Is the above extra '+' what compiler complains about? Patches from Linus' tree remove some code from that function, so applying them first should simplify the merge. > > 657b5146955e ("mm: lock_vma_under_rcu() must check vma->anon_vma unde= r vma lock") > > + goto inval_end_read; > > + > > /* Check since vm_start/vm_end might change before we lock the VM= A */ > > - if (unlikely(address < vma->vm_start || address >=3D vma->vm_end)= ) { > > - vma_end_read(vma); > > - goto inval; > > - } > > + if (unlikely(address < vma->vm_start || address >=3D vma->vm_end)= ) > > + goto inval_end_read; > > > > /* Check if the VMA got isolated after we found it */ > > if (vma->detached) { > > Sorry, doesn't even build ... let me try that again. > > -- > Cheers, > Stephen Rothwell