Skip to contentSkip to conversation

build error: allnoconfig fails on mincore/swapper_space

PATCH In review Randy Dunlap 8 participants 16 messages Feb 12, 2007 – Feb 15, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

2.6.20-git8 on x86_64:

LD init/built-in.o
LD .tmp_vmlinux1
mm/built-in.o: In function `sys_mincore':
(.text+0xe584): undefined reference to `swapper_space'
make: *** [.tmp_vmlinux1] Error 1

---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

maintainer
#1 lore raw
Quoted 9 lines · On Mon, 12 Feb 2007 14:50:40 -0800 Randy Dunlap <[email protected]> wrote:

2.6.20-git8 on x86_64:

LD init/built-in.o
LD .tmp_vmlinux1
mm/built-in.o: In function `sys_mincore':
(.text+0xe584): undefined reference to `swapper_space'
make: *** [.tmp_vmlinux1] Error 1

oops. CONFIG_SWAP=n, I assume?

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

#2 lore raw
Quoted 11 lines · Andrew Morton
Quoted 9 lines · On Mon, 12 Feb 2007 14:50:40 -0800 Randy Dunlap <[email protected]> wrote:

2.6.20-git8 on x86_64:

LD init/built-in.o
LD .tmp_vmlinux1
mm/built-in.o: In function `sys_mincore':
(.text+0xe584): undefined reference to `swapper_space'
make: *** [.tmp_vmlinux1] Error 1

oops. CONFIG_SWAP=n, I assume?

Yes, sorry. Full config attached.

Signature · 2 lines
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

#
# Automatically generated make config: don't edit # Linux kernel version: 2.6.20-git8
# Mon Feb 12 14:46:45 2007
#
CONFIG_X86_64=y
CONFIG_64BIT=y
CONFIG_X86=y
CONFIG_ZONE_DMA32=y
CONFIG_LOCKDEP_SUPPORT=y CONFIG_STACKTRACE_SUPPORT=y CONFIG_SEMAPHORE_SLEEPERS=y
CONFIG_MMU=y
CONFIG_ZONE_DMA=y
CONFIG_RWSEM_GENERIC_SPINLOCK=y CONFIG_GENERIC_HWEIGHT=y CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_X86_CMPXCHG=y
CONFIG_EARLY_PRINTK=y
CONFIG_GENERIC_ISA_DMA=y
CONFIG_GENERIC_IOMAP=y CONFIG_ARCH_MAY_HAVE_PC_FDC=y CONFIG_ARCH_POPULATES_NODE_MAP=y
CONFIG_DMI=y
CONFIG_AUDIT_ARCH=y
CONFIG_GENERIC_BUG=y
# CONFIG_ARCH_HAS_ILOG2_U32 is not set
# CONFIG_ARCH_HAS_ILOG2_U64 is not set CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"

#
# Code maturity level options
#
# CONFIG_EXPERIMENTAL is not set
CONFIG_BROKEN_ON_SMP=y
CONFIG_INIT_ENV_ARG_LIMIT=32

#
# General setup
#
CONFIG_LOCALVERSION=""
# CONFIG_LOCALVERSION_AUTO is not set
# CONFIG_SWAP is not set
# CONFIG_SYSVIPC is not set
# CONFIG_BSD_PROCESS_ACCT is not set
# CONFIG_UTS_NS is not set
# CONFIG_IKCONFIG is not set
# CONFIG_SYSFS_DEPRECATED is not set
# CONFIG_RELAY is not set
CONFIG_SYSCTL=y
# CONFIG_EMBEDDED is not set
CONFIG_SYSCTL_SYSCALL=y
CONFIG_KALLSYMS=y
# CONFIG_KALLSYMS_EXTRA_PASS is not set
CONFIG_HOTPLUG=y
CONFIG_PRINTK=y
CONFIG_BUG=y
CONFIG_ELF_CORE=y
CONFIG_BASE_FULL=y
CONFIG_FUTEX=y
CONFIG_EPOLL=y
CONFIG_SHMEM=y
CONFIG_SLAB=y
CONFIG_VM_EVENT_COUNTERS=y
CONFIG_RT_MUTEXES=y
# CONFIG_TINY_SHMEM is not set
CONFIG_BASE_SMALL=0
# CONFIG_SLOB is not set

#
# Loadable module support
#
# CONFIG_MODULES is not set

#
# Block layer
#
CONFIG_BLOCK=y
# CONFIG_BLK_DEV_IO_TRACE is not set

#
# IO Schedulers
#
CONFIG_IOSCHED_NOOP=y
# CONFIG_IOSCHED_AS is not set
# CONFIG_IOSCHED_DEADLINE is not set
# CONFIG_IOSCHED_CFQ is not set
# CONFIG_DEFAULT_AS is not set
# CONFIG_DEFAULT_DEADLINE is not set
# CONFIG_DEFAULT_CFQ is not set
CONFIG_DEFAULT_NOOP=y
CONFIG_DEFAULT_IOSCHED="noop"

#
# Processor type and features
#
CONFIG_X86_PC=y
# CONFIG_X86_VSMP is not set
# CONFIG_MK8 is not set
# CONFIG_MPSC is not set
# CONFIG_MCORE2 is not set
CONFIG_GENERIC_CPU=y
CONFIG_X86_L1_CACHE_BYTES=128
CONFIG_X86_L1_CACHE_SHIFT=7
CONFIG_X86_INTERNODE_CACHE_BYTES=128
CONFIG_X86_TSC=y
CONFIG_X86_GOOD_APIC=y
# CONFIG_MICROCODE is not set
# CONFIG_X86_MSR is not set
# CONFIG_X86_CPUID is not set
CONFIG_X86_IO_APIC=y
CONFIG_X86_LOCAL_APIC=y
# CONFIG_MTRR is not set
# CONFIG_SMP is not set
CONFIG_PREEMPT_NONE=y
# CONFIG_PREEMPT_VOLUNTARY is not set
# CONFIG_PREEMPT is not set
CONFIG_ARCH_FLATMEM_ENABLE=y
CONFIG_FLATMEM=y
CONFIG_FLAT_NODE_MEM_MAP=y
# CONFIG_SPARSEMEM_STATIC is not set
CONFIG_SPLIT_PTLOCK_CPUS=4
CONFIG_RESOURCES_64BIT=y
CONFIG_ZONE_DMA_FLAG=1
CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
CONFIG_HPET_TIMER=y
CONFIG_X86_MCE=y
# CONFIG_X86_MCE_INTEL is not set
# CONFIG_X86_MCE_AMD is not set
# CONFIG_KEXEC is not set
CONFIG_PHYSICAL_START=0x200000
# CONFIG_SECCOMP is not set
# CONFIG_HZ_100 is not set
CONFIG_HZ_250=y
# CONFIG_HZ_300 is not set
# CONFIG_HZ_1000 is not set
CONFIG_HZ=250
# CONFIG_REORDER is not set
CONFIG_GENERIC_HARDIRQS=y
CONFIG_GENERIC_IRQ_PROBE=y
CONFIG_ISA_DMA_API=y

#
# Power management options
#
# CONFIG_PM is not set

#
# ACPI (Advanced Configuration and Power Interface) Support #

#
# CPU Frequency scaling
#
# CONFIG_CPU_FREQ is not set

#
# Bus options (PCI etc.)
#
# CONFIG_PCI is not set

#
# PCCARD (PCMCIA/CardBus) support
#
# CONFIG_PCCARD is not set

#
# PCI Hotplug Support
#

#
# Executable file formats / Emulations
#
# CONFIG_BINFMT_ELF is not set
# CONFIG_BINFMT_MISC is not set
# CONFIG_IA32_EMULATION is not set

#
# Networking
#
# CONFIG_NET is not set

#
# Device Drivers
#

#
# Generic Driver Options
#
CONFIG_STANDALONE=y
# CONFIG_PREVENT_FIRMWARE_BUILD is not set
# CONFIG_FW_LOADER is not set
# CONFIG_SYS_HYPERVISOR is not set

#
# Connector - unified userspace <-> kernelspace linker #

#
# Memory Technology Devices (MTD)
#
# CONFIG_MTD is not set

#
# Parallel port support
#
# CONFIG_PARPORT is not set

#
# Plug and Play support
#

#
# Block devices
#
# CONFIG_BLK_DEV_FD is not set
# CONFIG_BLK_DEV_COW_COMMON is not set
# CONFIG_BLK_DEV_LOOP is not set
# CONFIG_BLK_DEV_RAM is not set
# CONFIG_BLK_DEV_INITRD is not set
# CONFIG_CDROM_PKTCDVD is not set

#
# Misc devices
#

#
# ATA/ATAPI/MFM/RLL support
#
# CONFIG_IDE is not set

#
# SCSI device support
#
# CONFIG_RAID_ATTRS is not set
# CONFIG_SCSI is not set
# CONFIG_SCSI_NETLINK is not set

#
# Serial ATA (prod) and Parallel ATA (experimental) drivers #
# CONFIG_ATA is not set

#
# Multi-device support (RAID and LVM)
#
# CONFIG_MD is not set

#
# Fusion MPT device support
#
# CONFIG_FUSION is not set

#
# IEEE 1394 (FireWire) support
#

#
# I2O device support
#

#
# Macintosh device drivers
#
# CONFIG_MAC_EMUMOUSEBTN is not set

#
# ISDN subsystem
#

#
# Telephony Support
#
# CONFIG_PHONE is not set

#
# Input device support
#
CONFIG_INPUT=y
# CONFIG_INPUT_FF_MEMLESS is not set

#
# Userland interfaces
#
CONFIG_INPUT_MOUSEDEV=y
# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
# CONFIG_INPUT_JOYDEV is not set
# CONFIG_INPUT_TSDEV is not set
# CONFIG_INPUT_EVDEV is not set
# CONFIG_INPUT_EVBUG is not set

#
# Input Device Drivers
#
CONFIG_INPUT_KEYBOARD=y
CONFIG_KEYBOARD_ATKBD=y
# CONFIG_KEYBOARD_SUNKBD is not set
# CONFIG_KEYBOARD_LKKBD is not set
# CONFIG_KEYBOARD_XTKBD is not set
# CONFIG_KEYBOARD_NEWTON is not set
# CONFIG_KEYBOARD_STOWAWAY is not set
# CONFIG_INPUT_MOUSE is not set
# CONFIG_INPUT_JOYSTICK is not set
# CONFIG_INPUT_TOUCHSCREEN is not set
# CONFIG_INPUT_MISC is not set

#
# Hardware I/O ports
#
CONFIG_SERIO=y
CONFIG_SERIO_I8042=y
# CONFIG_SERIO_SERPORT is not set
# CONFIG_SERIO_CT82C710 is not set
CONFIG_SERIO_LIBPS2=y
# CONFIG_SERIO_RAW is not set
# CONFIG_GAMEPORT is not set

#
# Character devices
#
CONFIG_VT=y
CONFIG_VT_CONSOLE=y
CONFIG_HW_CONSOLE=y
# CONFIG_VT_HW_CONSOLE_BINDING is not set
# CONFIG_SERIAL_NONSTANDARD is not set

#
# Serial drivers
#
# CONFIG_SERIAL_8250 is not set

#
# Non-8250 serial port support
#
CONFIG_UNIX98_PTYS=y
# CONFIG_LEGACY_PTYS is not set

#
# IPMI
#
# CONFIG_IPMI_HANDLER is not set

#
# Watchdog Cards
#
# CONFIG_WATCHDOG is not set
# CONFIG_HW_RANDOM is not set
# CONFIG_NVRAM is not set
# CONFIG_RTC is not set
# CONFIG_GEN_RTC is not set
# CONFIG_DTLK is not set
# CONFIG_R3964 is not set
# CONFIG_MWAVE is not set
# CONFIG_PC8736x_GPIO is not set
# CONFIG_RAW_DRIVER is not set
# CONFIG_HANGCHECK_TIMER is not set

#
# TPM devices
#

#
# I2C support
#
# CONFIG_I2C is not set

#
# SPI support
#
# CONFIG_SPI is not set
# CONFIG_SPI_MASTER is not set

#
# Dallas's 1-wire bus
#
# CONFIG_W1 is not set

#
# Hardware Monitoring support
#
# CONFIG_HWMON is not set
# CONFIG_HWMON_VID is not set

#
# Multimedia devices
#
# CONFIG_VIDEO_DEV is not set

#
# Digital Video Broadcasting Devices
#

#
# Graphics support
#
# CONFIG_FIRMWARE_EDID is not set
# CONFIG_FB is not set

#
# Console display driver support
#
CONFIG_VGA_CONSOLE=y
# CONFIG_VGACON_SOFT_SCROLLBACK is not set
# CONFIG_VIDEO_SELECT is not set
CONFIG_DUMMY_CONSOLE=y
# CONFIG_BACKLIGHT_LCD_SUPPORT is not set

#
# Sound
#
# CONFIG_SOUND is not set

#
# HID Devices
#
# CONFIG_HID is not set

#
# USB support
#
# CONFIG_USB_ARCH_HAS_HCD is not set
# CONFIG_USB_ARCH_HAS_OHCI is not set
# CONFIG_USB_ARCH_HAS_EHCI is not set

#
# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' #

#
# USB Gadget Support
#
# CONFIG_USB_GADGET is not set

#
# MMC/SD Card support
#
# CONFIG_MMC is not set

#
# LED devices
#
# CONFIG_NEW_LEDS is not set

#
# LED drivers
#

#
# LED Triggers
#

#
# InfiniBand support
#

#
# EDAC - error detection and reporting (RAS) (EXPERIMENTAL) #

#
# Real Time Clock
#

#
# DMA Engine support
#
# CONFIG_DMA_ENGINE is not set

#
# DMA Clients
#

#
# DMA Devices
#

#
# Auxiliary Display support
#

#
# Virtualization
#

#
# Firmware Drivers
#
# CONFIG_EDD is not set
# CONFIG_DELL_RBU is not set
# CONFIG_DCDBAS is not set

#
# File systems
#
# CONFIG_EXT2_FS is not set
# CONFIG_EXT3_FS is not set
# CONFIG_REISERFS_FS is not set
# CONFIG_JFS_FS is not set
# CONFIG_FS_POSIX_ACL is not set
# CONFIG_XFS_FS is not set
# CONFIG_MINIX_FS is not set
# CONFIG_ROMFS_FS is not set
# CONFIG_INOTIFY is not set
# CONFIG_QUOTA is not set
CONFIG_DNOTIFY=y
# CONFIG_AUTOFS_FS is not set
# CONFIG_AUTOFS4_FS is not set
# CONFIG_FUSE_FS is not set

#
# CD-ROM/DVD Filesystems
#
# CONFIG_ISO9660_FS is not set
# CONFIG_UDF_FS is not set

#
# DOS/FAT/NT Filesystems
#
# CONFIG_MSDOS_FS is not set
# CONFIG_VFAT_FS is not set
# CONFIG_NTFS_FS is not set

#
# Pseudo filesystems
#
CONFIG_PROC_FS=y
# CONFIG_PROC_KCORE is not set
CONFIG_PROC_SYSCTL=y
CONFIG_SYSFS=y
# CONFIG_TMPFS is not set
# CONFIG_HUGETLBFS is not set
# CONFIG_HUGETLB_PAGE is not set
CONFIG_RAMFS=y

#
# Miscellaneous filesystems
#
# CONFIG_HFSPLUS_FS is not set
# CONFIG_CRAMFS is not set
# CONFIG_VXFS_FS is not set
# CONFIG_HPFS_FS is not set
# CONFIG_QNX4FS_FS is not set
# CONFIG_SYSV_FS is not set
# CONFIG_UFS_FS is not set

#
# Partition Types
#
# CONFIG_PARTITION_ADVANCED is not set
CONFIG_MSDOS_PARTITION=y

#
# Native Language Support
#
# CONFIG_NLS is not set

#
# Kernel hacking
#
CONFIG_TRACE_IRQFLAGS_SUPPORT=y
# CONFIG_PRINTK_TIME is not set
# CONFIG_ENABLE_MUST_CHECK is not set
# CONFIG_MAGIC_SYSRQ is not set
# CONFIG_UNUSED_SYMBOLS is not set
# CONFIG_DEBUG_FS is not set
# CONFIG_HEADERS_CHECK is not set
# CONFIG_DEBUG_KERNEL is not set
CONFIG_LOG_BUF_SHIFT=14
CONFIG_DEBUG_BUGVERBOSE=y

#
# Security options
#
# CONFIG_KEYS is not set
# CONFIG_SECURITY is not set

#
# Cryptographic options
#
# CONFIG_CRYPTO is not set

#
# Library routines
#
# CONFIG_CRC_CCITT is not set
# CONFIG_CRC16 is not set
# CONFIG_CRC32 is not set
# CONFIG_LIBCRC32C is not set
CONFIG_PLIST=y
CONFIG_HAS_IOMEM=y
CONFIG_HAS_IOPORT=y

#4 lore raw
In reply to Andrew Morton
Quoted 4 lines · Andrew Morton
Quoted 4 lines · On Mon, 12 Feb 2007 14:50:40 -0800 Randy Dunlap <[email protected]> wrote:

2.6.20-git8 on x86_64:

Quoted 9 lines
Quoted 5 lines

LD init/built-in.o
LD .tmp_vmlinux1
mm/built-in.o: In function `sys_mincore':
(.text+0xe584): undefined reference to `swapper_space'
make: *** [.tmp_vmlinux1] Error 1

oops. CONFIG_SWAP=n, I assume?

Hmm, OK. Hugh can strip me of my bonus point now...

Hugh, you can strip me of my bonus point now... How about your other suggestion to just remove the stats from lookup_swap_cache? (and should we also rename it to find_get_swap_page?)

Thanks,
Nick

Signature · 8 lines
SUSE Labs, Novell Inc.
Send instant messages to your online friends http://au.messenger.yahoo.com 

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
#5 lore raw

PATCH 1/1 build error: allnoconfig fails on mincore/swapper_space

Quoted 12 lines · On Tue, 13 Feb 2007 13:48:53 +1100 Nick Piggin wrote:
Quoted 11 lines · Andrew Morton
Quoted 9 lines · On Mon, 12 Feb 2007 14:50:40 -0800 Randy Dunlap <[email protected]> wrote:

2.6.20-git8 on x86_64:

LD init/built-in.o
LD .tmp_vmlinux1
mm/built-in.o: In function `sys_mincore':
(.text+0xe584): undefined reference to `swapper_space'
make: *** [.tmp_vmlinux1] Error 1

Quoted 8 lines
Quoted 2 lines

oops. CONFIG_SWAP=n, I assume?

Hmm, OK. Hugh can strip me of my bonus point now...

Hugh, you can strip me of my bonus point now... How about your other suggestion to just remove the stats from lookup_swap_cache? (and should we also rename it to find_get_swap_page?)

I need a fix for this. It's killing my daily/automated builds. So here is an ifdeffery-fix.

BUT: what is <present> used for in that loop? or is it used?

---
From: Randy Dunlap <[email protected]>

Don't check for pte swap entries when CONFIG_SWAP=n.

mm/built-in.o: In function `sys_mincore':
(.text+0xe584): undefined reference to `swapper_space'

---
 mm/mincore.c |    4 ++++
 1 file changed, 4 insertions(+)
mm/mincore.c +4 -0
@@ -111,6 +111,7 @@ static long do_mincore(unsigned long add
 			present = mincore_page(vma->vm_file->f_mapping, pgoff);
 
 		} else { /* pte is a swap entry */
+#ifdef CONFIG_SWAP
 			swp_entry_t entry = pte_to_swp_entry(pte);
 			if (is_migration_entry(entry)) {
 				/* migration entries are always uptodate */
@@ -119,6 +120,9 @@ static long do_mincore(unsigned long add
 				pgoff = entry.val;
 				present = mincore_page(&swapper_space, pgoff);
 			}
+#else
+			present = 0;
+#endif
 		}
 	}
 	pte_unmap_unlock(ptep-1, ptl);

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

#6 lore raw
Quoted 13 lines · Randy Dunlap
Quoted 12 lines · On Tue, 13 Feb 2007 13:48:53 +1100 Nick Piggin wrote:
Quoted 11 lines · Andrew Morton
Quoted 9 lines · On Mon, 12 Feb 2007 14:50:40 -0800 Randy Dunlap <[email protected]> wrote:

2.6.20-git8 on x86_64:

LD init/built-in.o
LD .tmp_vmlinux1
mm/built-in.o: In function `sys_mincore':
(.text+0xe584): undefined reference to `swapper_space'
make: *** [.tmp_vmlinux1] Error 1

Quoted 4 lines
Quoted 4 lines
Quoted 2 lines

oops. CONFIG_SWAP=n, I assume?

Hmm, OK. Hugh can strip me of my bonus point now...

No, Nick, you get to keep your bonus point, it was for remembering migration pages. I was the devil who tempted you into using find_get_page(&swapper_space,).

Quoted 4 lines
Quoted 4 lines

Hugh, you can strip me of my bonus point now... How about your other suggestion to just remove the stats from lookup_swap_cache? (and should we also rename it to find_get_swap_page?)

Not at this point. I won't mind you putting up a patch doing that for discussion and inclusion in -mm (if you do, then read_swap_cache_async should use it too), but it's not now an appropriate fix to the CONFIG_SWAP=n build issue.

Quoted 3 lines

I need a fix for this. It's killing my daily/automated builds. So here is an ifdeffery-fix.

Sorry for being so slow to respond on this. Yes, I'm inclined to your ifdeffery fix - one can go cleverer, but I'd say it's the appropriate fix now.

But, please change your "present = 0;" to "present = 1;" - if CONFIG_SWAP isn't on, it has to be a migration entry, which always counts as present.

Quoted 2 lines

BUT: what is <present> used for in that loop? or is it used?

Well spotted! Something has gone missing: there needs to be a

			vec[i] = present;

at the bottom of that loop.

Hugh

Quoted 35 lines

---
From: Randy Dunlap <[email protected]>

Don't check for pte swap entries when CONFIG_SWAP=n.

mm/built-in.o: In function `sys_mincore':
(.text+0xe584): undefined reference to `swapper_space'

---
 mm/mincore.c |    4 ++++
 1 file changed, 4 insertions(+)
mm/mincore.c +4 -0
@@ -111,6 +111,7 @@ static long do_mincore(unsigned long add
 			present = mincore_page(vma->vm_file->f_mapping, pgoff);
 
 		} else { /* pte is a swap entry */
+#ifdef CONFIG_SWAP
 			swp_entry_t entry = pte_to_swp_entry(pte);
 			if (is_migration_entry(entry)) {
 				/* migration entries are always uptodate */
@@ -119,6 +120,9 @@ static long do_mincore(unsigned long add
 				pgoff = entry.val;
 				present = mincore_page(&swapper_space, pgoff);
 			}
+#else
+			present = 0;
+#endif
 		}
 	}
 	pte_unmap_unlock(ptep-1, ptl);
#7 lore raw
Quoted 11 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

oops. CONFIG_SWAP=n, I assume?

Sorry for being so slow to respond on this. Yes, I'm inclined to your ifdeffery fix - one can go cleverer, but I'd say it's the appropriate fix now.

But, please change your "present = 0;" to "present = 1;" - if CONFIG_SWAP isn't on, it has to be a migration entry, which always counts as present.

Quoted 1 line
Quoted 5 lines
Quoted 1 line

BUT: what is <present> used for in that loop? or is it used?

Well spotted! Something has gone missing: there needs to be a

			vec[i] = present;

at the bottom of that loop.

From: Randy Dunlap <[email protected]>

Don't check for pte swap entries when CONFIG_SWAP=n. And save 'present' in the vec array.

mm/built-in.o: In function `sys_mincore':
(.text+0xe584): undefined reference to `swapper_space'

---
 mm/mincore.c |    5 +++++
 1 file changed, 5 insertions(+)
mm/mincore.c +5 -0
@@ -111,6 +111,7 @@ static long do_mincore(unsigned long add
 			present = mincore_page(vma->vm_file->f_mapping, pgoff);
 
 		} else { /* pte is a swap entry */
+#ifdef CONFIG_SWAP
 			swp_entry_t entry = pte_to_swp_entry(pte);
 			if (is_migration_entry(entry)) {
 				/* migration entries are always uptodate */
@@ -119,7 +120,11 @@ static long do_mincore(unsigned long add
 				pgoff = entry.val;
 				present = mincore_page(&swapper_space, pgoff);
 			}
+#else
+			present = 1;
+#endif
 		}
+		vec[i] = present;
 	}
 	pte_unmap_unlock(ptep-1, ptl);
 

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

#8 lore raw
Quoted 9 lines · Randy Dunlap

From: Randy Dunlap <[email protected]>

Don't check for pte swap entries when CONFIG_SWAP=n. And save 'present' in the vec array.

mm/built-in.o: In function `sys_mincore':
(.text+0xe584): undefined reference to `swapper_space'

What you've done there is fine, Randy, thank you.

But I just got out of bed to take another look, and indeed:
what is it doing in the none_mapped !vma->vm_file case? passing back an uninitialized vector.

Easy enough to fix, but I'd say Nick's patch has by now exceeded its embarrassment quota, and should be reverted from Linus' tree for now: clearly none of us have been paying enough attention, and other eyes are liable to find further errors lurking in it.

Hugh

Quoted 15 lines
---
 mm/mincore.c |    5 +++++
 1 file changed, 5 insertions(+)
mm/mincore.c +1 -0
@@ -111,6 +111,7 @@ static long do_mincore(unsigned long add
 			present = mincore_page(vma->vm_file->f_mapping, pgoff);
 
 		} else { /* pte is a swap entry */
+#ifdef CONFIG_SWAP
 			swp_entry_t entry = pte_to_swp_entry(pte);
 			if (is_migration_entry(entry)) {
 				/* migration entries are always uptodate */

mm/mincore.c static long do_mincore(unsigned long add · line 129

Quoted 10 lines
mm/mincore.c +4 -0
@@ -119,7 +120,11 @@ static long do_mincore(unsigned long add
 				pgoff = entry.val;
 				present = mincore_page(&swapper_space, pgoff);
 			}
+#else
+			present = 1;
+#endif
 		}
+		vec[i] = present;
 	}
 	pte_unmap_unlock(ptep-1, ptl);

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

#9 lore raw
Quoted 7 lines · Hugh Dickins
Quoted 5 lines · Randy Dunlap

From: Randy Dunlap <[email protected]>

Don't check for pte swap entries when CONFIG_SWAP=n. And save 'present' in the vec array.

Quoted 7 lines
Quoted 4 lines

mm/built-in.o: In function `sys_mincore':
(.text+0xe584): undefined reference to `swapper_space'

What you've done there is fine, Randy, thank you.

Can't you have migration without swap?

Quoted 3 lines

But I just got out of bed to take another look, and indeed:
what is it doing in the none_mapped !vma->vm_file case? passing back an uninitialized vector.

I must have completely forgotten about the vector :(

Signature · 8 lines
SUSE Labs, Novell Inc.
Send instant messages to your online friends http://au.messenger.yahoo.com 

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
#10 lore raw
Quoted 2 lines · Nick Piggin

Can't you have migration without swap?

Yes: but then the only swap entry it can find (short of page table corruption, which isn't really the focus of mincore) is a migration entry, isn't it?

Hugh

#11 lore raw
Quoted 8 lines · Hugh Dickins
Quoted 1 line · Nick Piggin

Can't you have migration without swap?

Yes: but then the only swap entry it can find (short of page table corruption, which isn't really the focus of mincore) is a migration entry, isn't it?

Just doesn't seem logical to have CONFIG_SWAP ifdef cover the whole thing, regardless that it produces the desired result.

I'm going to submit a fixup patch to Linus covering all this stuff, after making a more comprehensive test case (yes I actually did test this patch with a few different cases before submitting it, so I must have been unlucky with uninitialised data).

If he wants to apply it rather than back out the patch entirely, its up to him.

I don't think there is any reason to panic. I did completely forget the result vector, but AFAIKS that's the only real bug in it.

Signature · 8 lines
SUSE Labs, Novell Inc.
Send instant messages to your online friends http://au.messenger.yahoo.com 

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
#13 lore raw
In reply to Hugh Dickins
Quoted 17 lines · On Wed, 14 Feb 2007 00:19:06 +0000 (GMT) Hugh Dickins wrote:
Quoted 9 lines · Randy Dunlap

From: Randy Dunlap <[email protected]>

Don't check for pte swap entries when CONFIG_SWAP=n. And save 'present' in the vec array.

mm/built-in.o: In function `sys_mincore':
(.text+0xe584): undefined reference to `swapper_space'

What you've done there is fine, Randy, thank you.

But I just got out of bed to take another look, and indeed:
what is it doing in the none_mapped !vma->vm_file case? passing back an uninitialized vector.

Quoted 6 lines

Easy enough to fix, but I'd say Nick's patch has by now exceeded its embarrassment quota, and should be reverted from Linus' tree for now: clearly none of us have been paying enough attention, and other eyes are liable to find further errors lurking in it.

Hugh

so, are we going to get a revert of 42da9cbd3eedde33a42acc2cb06f454814cf5de0 ? Has that been requested? or are there other plans?

Thanks.

Quoted 19 lines
Quoted 19 lines
---
 mm/mincore.c |    5 +++++
 1 file changed, 5 insertions(+)
mm/mincore.c +2 -0
@@ -111,6 +111,7 @@ static long do_mincore(unsigned long add
 			present = mincore_page(vma->vm_file->f_mapping, pgoff);
 
 		} else { /* pte is a swap entry */
+#ifdef CONFIG_SWAP
 			swp_entry_t entry = pte_to_swp_entry(pte);
 			if (is_migration_entry(entry)) {
 				/* migration entries are always uptodate */
@@ -119,7 +120,11 @@ static long do_mincore(unsigned long add
 				pgoff = entry.val;
 				present = mincore_page(&swapper_space, pgoff);
 			}
+#else
Quoted 8 lines

mm/mincore.c static long do_mincore(unsigned long add · line 129

Quoted 6 lines
mm/mincore.c +3 -0
+			present = 1;
+#endif
 		}
+		vec[i] = present;
 	}
 	pte_unmap_unlock(ptep-1, ptl);

--

---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

#14 lore raw
Quoted 3 lines · Randy Dunlap

so, are we going to get a revert of 42da9cbd3eedde33a42acc2cb06f454814cf5de0 ? Has that been requested? or are there other plans?

It should be fixed now (I had patches from Nick, but got sidetracked by trying to fix metacity for the gnome people).

I've pushed out, but mirroring delays mean that unless you use master.kernel.org you'll need to wait a bit. I think Nick cc'd the kernel mailing list, though, so you can look for subjects containing "mincore" if you need it fixed before that.

Linus

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

#15 lore raw
Quoted 5 lines · Linus Torvalds
Quoted 2 lines · Randy Dunlap

so, are we going to get a revert of 42da9cbd3eedde33a42acc2cb06f454814cf5de0 ? Has that been requested? or are there other plans?

It should be fixed now (I had patches from Nick, but got sidetracked by trying to fix metacity for the gnome people).

Wow, good luck with that. metacity has, among other things, been making my web browser (firefox) and my lone game (nethack) behave strangely when it comes to opening new windows.

Jeff

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>