linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [linux-next:master 14680/14811] mm/filemap.c:4250:1: sparse: sparse: Using plain integer as NULL pointer
@ 2023-05-07  0:28 kernel test robot
  2023-05-08 16:45 ` Nhat Pham
  0 siblings, 1 reply; 4+ messages in thread
From: kernel test robot @ 2023-05-07  0:28 UTC (permalink / raw)
  To: Nhat Pham; +Cc: oe-kbuild-all, Linux Memory Management List, Andrew Morton

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   83e5775d7afda68f6d7576d21f7a080fbfeecc4f
commit: d39c65bc7fcb1dad22dc1585fc669b5bfe5d3108 [14680/14811] cachestat: implement cachestat syscall
config: s390-randconfig-s041-20230507 (https://download.01.org/0day-ci/archive/20230507/202305070840.X0G3ofjl-lkp@intel.com/config)
compiler: s390-linux-gcc (GCC) 12.1.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.4-39-gce1a6720-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=d39c65bc7fcb1dad22dc1585fc669b5bfe5d3108
        git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
        git fetch --no-tags linux-next master
        git checkout d39c65bc7fcb1dad22dc1585fc669b5bfe5d3108
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=s390 olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=s390 SHELL=/bin/bash

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202305070840.X0G3ofjl-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
   mm/filemap.c:1416:17: sparse: sparse: context imbalance in 'migration_entry_wait_on_locked' - unexpected unlock
>> mm/filemap.c:4250:1: sparse: sparse: Using plain integer as NULL pointer
>> mm/filemap.c:4250:1: sparse: sparse: Using plain integer as NULL pointer
>> mm/filemap.c:4250:1: sparse: sparse: Using plain integer as NULL pointer
>> mm/filemap.c:4250:1: sparse: sparse: Using plain integer as NULL pointer

vim +4250 mm/filemap.c

  4215	
  4216	/*
  4217	 * The cachestat(2) system call.
  4218	 *
  4219	 * cachestat() returns the page cache statistics of a file in the
  4220	 * bytes range specified by `off` and `len`: number of cached pages,
  4221	 * number of dirty pages, number of pages marked for writeback,
  4222	 * number of evicted pages, and number of recently evicted pages.
  4223	 *
  4224	 * An evicted page is a page that is previously in the page cache
  4225	 * but has been evicted since. A page is recently evicted if its last
  4226	 * eviction was recent enough that its reentry to the cache would
  4227	 * indicate that it is actively being used by the system, and that
  4228	 * there is memory pressure on the system.
  4229	 *
  4230	 * `off` and `len` must be non-negative integers. If `len` > 0,
  4231	 * the queried range is [`off`, `off` + `len`]. If `len` == 0,
  4232	 * we will query in the range from `off` to the end of the file.
  4233	 *
  4234	 * The `flags` argument is unused for now, but is included for future
  4235	 * extensibility. User should pass 0 (i.e no flag specified).
  4236	 *
  4237	 * Currently, hugetlbfs is not supported.
  4238	 *
  4239	 * Because the status of a page can change after cachestat() checks it
  4240	 * but before it returns to the application, the returned values may
  4241	 * contain stale information.
  4242	 *
  4243	 * return values:
  4244	 *  zero        - success
  4245	 *  -EFAULT     - cstat or cstat_range points to an illegal address
  4246	 *  -EINVAL     - invalid flags
  4247	 *  -EBADF      - invalid file descriptor
  4248	 *  -EOPNOTSUPP - file descriptor is of a hugetlbfs file
  4249	 */
> 4250	SYSCALL_DEFINE4(cachestat, unsigned int, fd,

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [linux-next:master 14680/14811] mm/filemap.c:4250:1: sparse: sparse: Using plain integer as NULL pointer
  2023-05-07  0:28 [linux-next:master 14680/14811] mm/filemap.c:4250:1: sparse: sparse: Using plain integer as NULL pointer kernel test robot
@ 2023-05-08 16:45 ` Nhat Pham
  2023-05-08 16:57   ` Heiko Carstens
  0 siblings, 1 reply; 4+ messages in thread
From: Nhat Pham @ 2023-05-08 16:45 UTC (permalink / raw)
  To: kernel test robot
  Cc: oe-kbuild-all, Linux Memory Management List, Andrew Morton, hca,
	gor, agordeev, borntraeger, svens, linux-s390

On Sat, May 6, 2023 at 5:28 PM kernel test robot <lkp@intel.com> wrote:
>
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> head:   83e5775d7afda68f6d7576d21f7a080fbfeecc4f
> commit: d39c65bc7fcb1dad22dc1585fc669b5bfe5d3108 [14680/14811] cachestat: implement cachestat syscall
> config: s390-randconfig-s041-20230507 (https://download.01.org/0day-ci/archive/20230507/202305070840.X0G3ofjl-lkp@intel.com/config)
> compiler: s390-linux-gcc (GCC) 12.1.0
> reproduce:
>         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>         chmod +x ~/bin/make.cross
>         # apt-get install sparse
>         # sparse version: v0.6.4-39-gce1a6720-dirty
>         # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=d39c65bc7fcb1dad22dc1585fc669b5bfe5d3108
>         git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
>         git fetch --no-tags linux-next master
>         git checkout d39c65bc7fcb1dad22dc1585fc669b5bfe5d3108
>         # save the config file
>         mkdir build_dir && cp config build_dir/.config
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=s390 olddefconfig
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=s390 SHELL=/bin/bash
>
> If you fix the issue, kindly add following tag where applicable
> | Reported-by: kernel test robot <lkp@intel.com>
> | Link: https://lore.kernel.org/oe-kbuild-all/202305070840.X0G3ofjl-lkp@intel.com/
>
> sparse warnings: (new ones prefixed by >>)
>    mm/filemap.c:1416:17: sparse: sparse: context imbalance in 'migration_entry_wait_on_locked' - unexpected unlock
> >> mm/filemap.c:4250:1: sparse: sparse: Using plain integer as NULL pointer
> >> mm/filemap.c:4250:1: sparse: sparse: Using plain integer as NULL pointer
> >> mm/filemap.c:4250:1: sparse: sparse: Using plain integer as NULL pointer
> >> mm/filemap.c:4250:1: sparse: sparse: Using plain integer as NULL pointer
>
> vim +4250 mm/filemap.c
>
>   4215
>   4216  /*
>   4217   * The cachestat(2) system call.
>   4218   *
>   4219   * cachestat() returns the page cache statistics of a file in the
>   4220   * bytes range specified by `off` and `len`: number of cached pages,
>   4221   * number of dirty pages, number of pages marked for writeback,
>   4222   * number of evicted pages, and number of recently evicted pages.
>   4223   *
>   4224   * An evicted page is a page that is previously in the page cache
>   4225   * but has been evicted since. A page is recently evicted if its last
>   4226   * eviction was recent enough that its reentry to the cache would
>   4227   * indicate that it is actively being used by the system, and that
>   4228   * there is memory pressure on the system.
>   4229   *
>   4230   * `off` and `len` must be non-negative integers. If `len` > 0,
>   4231   * the queried range is [`off`, `off` + `len`]. If `len` == 0,
>   4232   * we will query in the range from `off` to the end of the file.
>   4233   *
>   4234   * The `flags` argument is unused for now, but is included for future
>   4235   * extensibility. User should pass 0 (i.e no flag specified).
>   4236   *
>   4237   * Currently, hugetlbfs is not supported.
>   4238   *
>   4239   * Because the status of a page can change after cachestat() checks it
>   4240   * but before it returns to the application, the returned values may
>   4241   * contain stale information.
>   4242   *
>   4243   * return values:
>   4244   *  zero        - success
>   4245   *  -EFAULT     - cstat or cstat_range points to an illegal address
>   4246   *  -EINVAL     - invalid flags
>   4247   *  -EBADF      - invalid file descriptor
>   4248   *  -EOPNOTSUPP - file descriptor is of a hugetlbfs file
>   4249   */
> > 4250  SYSCALL_DEFINE4(cachestat, unsigned int, fd,
>
> --
> 0-DAY CI Kernel Test Service
> https://github.com/intel/lkp-tests

Hmm I couldn't see where I used 0 as the null pointer. Maybe
this is a false positive or a result of not wiring up the syscall
for s390? Especially since this is pointed toward the macro
line (SYSCALL_DEFINE).

cc-ing this to s390 maintainers and the s390 mailing list...
Could you help me debug this? Thanks!


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [linux-next:master 14680/14811] mm/filemap.c:4250:1: sparse: sparse: Using plain integer as NULL pointer
  2023-05-08 16:45 ` Nhat Pham
@ 2023-05-08 16:57   ` Heiko Carstens
  2023-05-08 17:26     ` Nhat Pham
  0 siblings, 1 reply; 4+ messages in thread
From: Heiko Carstens @ 2023-05-08 16:57 UTC (permalink / raw)
  To: Nhat Pham
  Cc: kernel test robot, oe-kbuild-all, Linux Memory Management List,
	Andrew Morton, gor, agordeev, borntraeger, svens, linux-s390

On Mon, May 08, 2023 at 09:45:56AM -0700, Nhat Pham wrote:
> On Sat, May 6, 2023 at 5:28 PM kernel test robot <lkp@intel.com> wrote:
> > sparse warnings: (new ones prefixed by >>)
> >    mm/filemap.c:1416:17: sparse: sparse: context imbalance in 'migration_entry_wait_on_locked' - unexpected unlock
> > >> mm/filemap.c:4250:1: sparse: sparse: Using plain integer as NULL pointer
> > >> mm/filemap.c:4250:1: sparse: sparse: Using plain integer as NULL pointer
> > >> mm/filemap.c:4250:1: sparse: sparse: Using plain integer as NULL pointer
...
> > > 4250  SYSCALL_DEFINE4(cachestat, unsigned int, fd,
> 
> Hmm I couldn't see where I used 0 as the null pointer. Maybe
> this is a false positive or a result of not wiring up the syscall
> for s390? Especially since this is pointed toward the macro
> line (SYSCALL_DEFINE).
> 
> cc-ing this to s390 maintainers and the s390 mailing list...
> Could you help me debug this? Thanks!

Just ignore, this is a known false positive with s390's SYSCALL_DEFINE()
implementation vs sparse. I looked into it once, but couldn't figure out
how to silence sparse.
IIRC, the __TYPE_IS_PTR() macro causes this.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [linux-next:master 14680/14811] mm/filemap.c:4250:1: sparse: sparse: Using plain integer as NULL pointer
  2023-05-08 16:57   ` Heiko Carstens
@ 2023-05-08 17:26     ` Nhat Pham
  0 siblings, 0 replies; 4+ messages in thread
From: Nhat Pham @ 2023-05-08 17:26 UTC (permalink / raw)
  To: Heiko Carstens
  Cc: kernel test robot, oe-kbuild-all, Linux Memory Management List,
	Andrew Morton, gor, agordeev, borntraeger, svens, linux-s390

On Mon, May 8, 2023 at 9:57 AM Heiko Carstens <hca@linux.ibm.com> wrote:
>
> On Mon, May 08, 2023 at 09:45:56AM -0700, Nhat Pham wrote:
> > On Sat, May 6, 2023 at 5:28 PM kernel test robot <lkp@intel.com> wrote:
> > > sparse warnings: (new ones prefixed by >>)
> > >    mm/filemap.c:1416:17: sparse: sparse: context imbalance in 'migration_entry_wait_on_locked' - unexpected unlock
> > > >> mm/filemap.c:4250:1: sparse: sparse: Using plain integer as NULL pointer
> > > >> mm/filemap.c:4250:1: sparse: sparse: Using plain integer as NULL pointer
> > > >> mm/filemap.c:4250:1: sparse: sparse: Using plain integer as NULL pointer
> ...
> > > > 4250  SYSCALL_DEFINE4(cachestat, unsigned int, fd,
> >
> > Hmm I couldn't see where I used 0 as the null pointer. Maybe
> > this is a false positive or a result of not wiring up the syscall
> > for s390? Especially since this is pointed toward the macro
> > line (SYSCALL_DEFINE).
> >
> > cc-ing this to s390 maintainers and the s390 mailing list...
> > Could you help me debug this? Thanks!
>
> Just ignore, this is a known false positive with s390's SYSCALL_DEFINE()
> implementation vs sparse. I looked into it once, but couldn't figure out
> how to silence sparse.
> IIRC, the __TYPE_IS_PTR() macro causes this.

Thanks for the prompt response and support, Heiko!


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-05-08 17:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-07  0:28 [linux-next:master 14680/14811] mm/filemap.c:4250:1: sparse: sparse: Using plain integer as NULL pointer kernel test robot
2023-05-08 16:45 ` Nhat Pham
2023-05-08 16:57   ` Heiko Carstens
2023-05-08 17:26     ` Nhat Pham

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox