Content-Type: multipart/mixed; boundary="===============2298445293960517870==" MIME-Version: 1.0 From: Steven Price To: kbuild-all@lists.01.org Subject: Re: [PATCH v16 13/25] mm: pagewalk: Don't lock PTEs for walk_page_range_novma() Date: Wed, 11 Dec 2019 15:54:06 +0000 Message-ID: In-Reply-To: <201912101842.KIXI4yCg%lkp@intel.com> List-Id: --===============2298445293960517870== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable On 10/12/2019 11:23, kbuild test robot wrote: > Hi Steven, > = > I love your patch! Perhaps something to improve: > = > [auto build test WARNING on linus/master] > [also build test WARNING on v5.5-rc1 next-20191209] > [cannot apply to arm64/for-next/core tip/x86/mm] > [if your patch is applied to the wrong git tree, please drop us a note to= help > improve the system. BTW, we also suggest to use '--base' option to specif= y the > base tree in git format-patch, please see https://stackoverflow.com/a/374= 06982] > = > url: https://github.com/0day-ci/linux/commits/Steven-Price/Generic-pag= e-walk-and-ptdump/20191208-035831 > base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.gi= t ad910e36da4ca3a1bd436989f632d062dda0c921 > reproduce: > # apt-get install sparse > # sparse version: v0.6.1-101-g82dee2e-dirty > make ARCH=3Dx86_64 allmodconfig > make C=3D1 CF=3D'-fdiagnostic-prefix -D__CHECK_ENDIAN__' > = > If you fix the issue, kindly add following tag > Reported-by: kbuild test robot > = > = > sparse warnings: (new ones prefixed by >>) > = >>> include/linux/spinlock.h:378:9: sparse: sparse: context imbalance in 'w= alk_pte_range' - unexpected unlock I believe this is a false positive (although the trace here is useless). This patch adds a conditional lock/unlock: pte =3D walk->no_vma ? pte_offset_map(pmd, addr) : pte_offset_map_lock(walk->mm, pmd, addr, &ptl); ... if (!walk->no_vma) spin_unlock(ptl); pte_unmap(pte); I'm not sure how to match sparse happy about that. Is the only option to have two versions of the walk_pte_range() function? One which takes the lock and one which doesn't. Steve > vim +/walk_pte_range +378 include/linux/spinlock.h > = > c2f21ce2e31286 Thomas Gleixner 2009-12-02 375 = > 3490565b633c70 Denys Vlasenko 2015-07-13 376 static __always_inline vo= id spin_unlock(spinlock_t *lock) > c2f21ce2e31286 Thomas Gleixner 2009-12-02 377 { > c2f21ce2e31286 Thomas Gleixner 2009-12-02 @378 raw_spin_unlock(&lock->r= lock); > c2f21ce2e31286 Thomas Gleixner 2009-12-02 379 } > c2f21ce2e31286 Thomas Gleixner 2009-12-02 380 = > = > :::::: The code at line 378 was first introduced by commit > :::::: c2f21ce2e31286a0a32f8da0a7856e9ca1122ef3 locking: Implement new ra= w_spinlock > = > :::::: TO: Thomas Gleixner > :::::: CC: Thomas Gleixner > = > --- > 0-DAY kernel test infrastructure Open Source Technology C= enter > https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org Intel Corp= oration > = > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel(a)lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel >=20 --===============2298445293960517870==--