Content-Type: multipart/mixed; boundary="===============3782414717409619716==" MIME-Version: 1.0 From: John Hubbard To: kbuild-all@lists.01.org Subject: Re: [PATCH 2/2] mm/gup: fix a misnamed "write" argument: should be "flags" Date: Sun, 13 Oct 2019 23:43:10 -0700 Message-ID: In-Reply-To: <201910141316.DHpeevy3%lkp@intel.com> List-Id: --===============3782414717409619716== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable On 10/13/19 11:12 PM, kbuild test robot wrote: > Hi John, > = > Thank you for the patch! Yet something to improve: > = > [auto build test ERROR on linus/master] > [cannot apply to v5.4-rc3 next-20191011] > [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/John-Hubbard/gup-c-gup_b= enchmark-c-trivial-fixes-before-the-storm/20191014-114158 > config: powerpc-defconfig (attached as .config) > compiler: powerpc64-linux-gcc (GCC) 7.4.0 > reproduce: > wget https://raw.githubusercontent.com/intel/lkp-tests/master/sb= in/make.cross -O ~/bin/make.cross > chmod +x ~/bin/make.cross > # save the attached .config to linux build tree > GCC_VERSION=3D7.4.0 make.cross ARCH=3Dpowerpc > = > If you fix the issue, kindly add following tag > Reported-by: kbuild test robot > = > All errors (new ones prefixed by >>): > = > mm/gup.c: In function 'gup_hugepte': >>> mm/gup.c:1990:33: error: 'write' undeclared (first use in this function= ); did you mean 'writeq'? > if (!pte_access_permitted(pte, write)) > ^~~~~ > writeq > mm/gup.c:1990:33: note: each undeclared identifier is reported only o= nce for each function it appears in > = OK, so this shows that my cross-compiler test scripts are faulty lately, sorry I missed this. But more importantly, the above missed case is an example of when "write" r= eally means "write", as opposed to meaning flags. Please put this patch on hold or drop it, until we hear from the authors as= to how they would like to resolve this. I suspect it will end up as something like: bool write =3D (flags & FOLL_WRITE); ...perhaps? thanks, -- = John Hubbard NVIDIA > vim +1990 mm/gup.c > = > cbd34da7dc9afd Christoph Hellwig 2019-07-11 1974 > cbd34da7dc9afd Christoph Hellwig 2019-07-11 1975 static int gup_hugepte= (pte_t *ptep, unsigned long sz, unsigned long addr, > cc492e4c15e804 John Hubbard 2019-10-13 1976 unsigned long= end, int flags, struct page **pages, > cc492e4c15e804 John Hubbard 2019-10-13 1977 int *nr) > cbd34da7dc9afd Christoph Hellwig 2019-07-11 1978 { > cbd34da7dc9afd Christoph Hellwig 2019-07-11 1979 unsigned long pte_end; > cbd34da7dc9afd Christoph Hellwig 2019-07-11 1980 struct page *head, *p= age; > cbd34da7dc9afd Christoph Hellwig 2019-07-11 1981 pte_t pte; > cbd34da7dc9afd Christoph Hellwig 2019-07-11 1982 int refs; > cbd34da7dc9afd Christoph Hellwig 2019-07-11 1983 > cbd34da7dc9afd Christoph Hellwig 2019-07-11 1984 pte_end =3D (addr + s= z) & ~(sz-1); > cbd34da7dc9afd Christoph Hellwig 2019-07-11 1985 if (pte_end < end) > cbd34da7dc9afd Christoph Hellwig 2019-07-11 1986 end =3D pte_end; > cbd34da7dc9afd Christoph Hellwig 2019-07-11 1987 > cbd34da7dc9afd Christoph Hellwig 2019-07-11 1988 pte =3D READ_ONCE(*pt= ep); > cbd34da7dc9afd Christoph Hellwig 2019-07-11 1989 > cbd34da7dc9afd Christoph Hellwig 2019-07-11 @1990 if (!pte_access_permi= tted(pte, write)) > cbd34da7dc9afd Christoph Hellwig 2019-07-11 1991 return 0; > cbd34da7dc9afd Christoph Hellwig 2019-07-11 1992 > cbd34da7dc9afd Christoph Hellwig 2019-07-11 1993 /* hugepages are neve= r "special" */ > cbd34da7dc9afd Christoph Hellwig 2019-07-11 1994 VM_BUG_ON(!pfn_valid(= pte_pfn(pte))); > cbd34da7dc9afd Christoph Hellwig 2019-07-11 1995 > cbd34da7dc9afd Christoph Hellwig 2019-07-11 1996 refs =3D 0; > cbd34da7dc9afd Christoph Hellwig 2019-07-11 1997 head =3D pte_page(pte= ); > cbd34da7dc9afd Christoph Hellwig 2019-07-11 1998 > cbd34da7dc9afd Christoph Hellwig 2019-07-11 1999 page =3D head + ((add= r & (sz-1)) >> PAGE_SHIFT); > cbd34da7dc9afd Christoph Hellwig 2019-07-11 2000 do { > cbd34da7dc9afd Christoph Hellwig 2019-07-11 2001 VM_BUG_ON(compound_h= ead(page) !=3D head); > cbd34da7dc9afd Christoph Hellwig 2019-07-11 2002 pages[*nr] =3D page; > cbd34da7dc9afd Christoph Hellwig 2019-07-11 2003 (*nr)++; > cbd34da7dc9afd Christoph Hellwig 2019-07-11 2004 page++; > cbd34da7dc9afd Christoph Hellwig 2019-07-11 2005 refs++; > cbd34da7dc9afd Christoph Hellwig 2019-07-11 2006 } while (addr +=3D PA= GE_SIZE, addr !=3D end); > cbd34da7dc9afd Christoph Hellwig 2019-07-11 2007 > 01a369160bbea4 Christoph Hellwig 2019-07-11 2008 head =3D try_get_comp= ound_head(head, refs); > 01a369160bbea4 Christoph Hellwig 2019-07-11 2009 if (!head) { > cbd34da7dc9afd Christoph Hellwig 2019-07-11 2010 *nr -=3D refs; > cbd34da7dc9afd Christoph Hellwig 2019-07-11 2011 return 0; > cbd34da7dc9afd Christoph Hellwig 2019-07-11 2012 } > cbd34da7dc9afd Christoph Hellwig 2019-07-11 2013 > cbd34da7dc9afd Christoph Hellwig 2019-07-11 2014 if (unlikely(pte_val(= pte) !=3D pte_val(*ptep))) { > cbd34da7dc9afd Christoph Hellwig 2019-07-11 2015 /* Could be optimize= d better */ > cbd34da7dc9afd Christoph Hellwig 2019-07-11 2016 *nr -=3D refs; > cbd34da7dc9afd Christoph Hellwig 2019-07-11 2017 while (refs--) > cbd34da7dc9afd Christoph Hellwig 2019-07-11 2018 put_page(head); > cbd34da7dc9afd Christoph Hellwig 2019-07-11 2019 return 0; > cbd34da7dc9afd Christoph Hellwig 2019-07-11 2020 } > cbd34da7dc9afd Christoph Hellwig 2019-07-11 2021 > 520b4a4496f12b Christoph Hellwig 2019-07-11 2022 SetPageReferenced(hea= d); > cbd34da7dc9afd Christoph Hellwig 2019-07-11 2023 return 1; > cbd34da7dc9afd Christoph Hellwig 2019-07-11 2024 } > cbd34da7dc9afd Christoph Hellwig 2019-07-11 2025 > = > :::::: The code at line 1990 was first introduced by commit > :::::: cbd34da7dc9afd521e0bea5e7d12701f4a9da7c7 mm: move the powerpc huge= pd code to mm/gup.c > = > :::::: TO: Christoph Hellwig > :::::: CC: Linus Torvalds > = > --- > 0-DAY kernel test infrastructure Open Source Technology Ce= nter > https://lists.01.org/pipermail/kbuild-all Intel Corpora= tion >=20 --===============3782414717409619716==--