All of lore.kernel.org
 help / color / mirror / Atom feed
* linux-next: Tree for Aug 4
@ 2011-08-04  4:58 Stephen Rothwell
  2011-08-04 21:24 ` linux-next: Tree for Aug 4 (zcache) Randy Dunlap
  2011-08-04 22:22   ` Randy Dunlap
  0 siblings, 2 replies; 41+ messages in thread
From: Stephen Rothwell @ 2011-08-04  4:58 UTC (permalink / raw)
  To: linux-next; +Cc: LKML

[-- Attachment #1: Type: text/plain, Size: 19141 bytes --]

Hi all,

Just in case anyone needs reminding:  Please do not add anything destined
for v3.2 into linux-next included trees until after v3.1-rc1.

The powerpc allyesconfig build (at least) fails today.

Changes since 20110803:

The staging.current tree lost its build failure.

The devicetree tree gained a build failure for which I reverted a commit.

The moduleh tree lost a conflict but gained another against the
staging.current tree another build failure for which I added a fix patch.

The akpm tree gained another build fix.

----------------------------------------------------------------------------

I have created today's linux-next tree at
git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
(patches at http://www.kernel.org/pub/linux/kernel/v2.6/next/ ).  If you
are tracking the linux-next tree using git, you should not use "git pull"
to do so as that will try to merge the new linux-next release with the
old one.  You should use "git fetch" as mentioned in the FAQ on the wiki
(see below).

You can see which trees have been included by looking in the Next/Trees
file in the source.  There are also quilt-import.log and merge.log files
in the Next directory.  Between each merge, the tree was built with
a ppc64_defconfig for powerpc and an allmodconfig for x86_64. After the
final fixups (if any), it is also built with powerpc allnoconfig (32 and
64 bit), ppc44x_defconfig and allyesconfig (minus
CONFIG_PROFILE_ALL_BRANCHES - this fails its final link) and i386, sparc
and sparc64 defconfig. These builds also have
CONFIG_ENABLE_WARN_DEPRECATED, CONFIG_ENABLE_MUST_CHECK and
CONFIG_DEBUG_INFO disabled when necessary.

Below is a summary of the state of the merge.

We are up to 200 trees (counting Linus' and 28 trees of patches pending
for Linus' tree), more are welcome (even if they are currently empty).
Thanks to those who have contributed, and to those who haven't, please do.

Status of my local build tests will be at
http://kisskb.ellerman.id.au/linux-next .  If maintainers want to give
advice about cross compilers/configs that work, we are always open to add
more builds.

Thanks to Randy Dunlap for doing many randconfig builds.

There is a wiki covering stuff to do with linux-next at
http://linux.f-seidel.de/linux-next/pmwiki/ .  Thanks to Frank Seidel.

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

$ git checkout master
$ git reset --hard stable
Merging origin/master
Merging fixes/fixes
Merging kbuild-current/rc-fixes
Merging arm-current/master
Merging m68k-current/for-linus
Merging powerpc-merge/merge
Merging 52xx-and-virtex-current/powerpc/merge
Merging sparc-current/master
Merging scsi-rc-fixes/master
Merging net-current/master
Merging sound-current/for-linus
Merging pci-current/for-linus
Merging wireless-current/master
Merging driver-core.current/driver-core-linus
Merging tty.current/tty-linus
Merging usb.current/usb-linus
Merging staging.current/staging-linus
Merging cpufreq-current/fixes
Merging input-current/for-linus
Merging md-current/for-linus
Merging audit-current/for-linus
Merging crypto-current/master
Merging ide-curent/master
Merging dwmw2/master
Merging sh-current/sh-fixes-for-linus
Merging rmobile-current/rmobile-fixes-for-linus
Merging fbdev-current/fbdev-fixes-for-linus
Merging devicetree-current/devicetree/merge
Merging spi-current/spi/merge
Merging arm/for-next
Merging arm-lpae/for-next
CONFLICT (content): Merge conflict in arch/arm/include/asm/pgalloc.h
CONFLICT (content): Merge conflict in arch/arm/include/asm/pgtable.h
CONFLICT (content): Merge conflict in arch/arm/include/asm/proc-fns.h
CONFLICT (content): Merge conflict in arch/arm/include/asm/tlb.h
CONFLICT (content): Merge conflict in arch/arm/mm/context.c
CONFLICT (content): Merge conflict in arch/arm/mm/proc-v7.S
Merging arm-soc/for-next
CONFLICT (content): Merge conflict in arch/arm/mach-exynos4/pm.c
CONFLICT (content): Merge conflict in arch/arm/mach-imx/mm-imx25.c
CONFLICT (content): Merge conflict in arch/arm/mach-imx/mm-imx31.c
CONFLICT (content): Merge conflict in arch/arm/mach-imx/mm-imx35.c
CONFLICT (content): Merge conflict in arch/arm/mach-mx5/mm.c
CONFLICT (content): Merge conflict in arch/arm/mach-omap2/cm-regbits-44xx.h
Merging at91/at91-next
Merging davinci/davinci-next
Merging i.MX/for-next
Merging linux-spec/for-next
Merging msm/for-next
CONFLICT (content): Merge conflict in arch/arm/mach-msm/io.c
Merging omap/for-next
Merging pxa/for-next
Merging samsung/next-samsung
Merging s5p/for-next
CONFLICT (content): Merge conflict in arch/arm/mach-exynos4/Kconfig
CONFLICT (content): Merge conflict in arch/arm/mach-exynos4/mach-smdkc210.c
Merging tegra/for-next
Merging ux500-core/ux500-core
Merging xilinx/arm-next
Merging blackfin/for-linus
Merging cris/for-next
Merging ia64/test
Merging m68k/for-next
Merging m68knommu/for-next
Merging microblaze/next
Merging mips/mips-for-linux-next
Merging openrisc/for-upstream
Merging parisc/for-next
Merging powerpc/next
Merging 4xx/next
Merging 52xx-and-virtex/powerpc/next
Merging galak/next
Merging s390/features
Merging sh/sh-latest
Merging rmobile/rmobile-latest
Merging sparc/master
Merging tile/master
Merging unicore32/unicore32
Merging xtensa/master
Merging ceph/for-next
CONFLICT (content): Merge conflict in fs/ceph/export.c
Merging cifs/master
Merging configfs/linux-next
Merging ecryptfs/next
Merging ext3/for_next
Merging ext4/dev
Merging fatfs/master
Merging fuse/for-next
Merging gfs2/master
Merging hfsplus/for-next
Merging jfs/next
Merging logfs/master
CONFLICT (content): Merge conflict in fs/logfs/logfs.h
Merging nfs/linux-next
Merging nfsd/nfsd-next
Merging nilfs2/for-next
Merging ocfs2/linux-next
Merging omfs/for-next
Merging squashfs/master
Merging udf/for_next
Merging v9fs/for-next
Merging ubifs/linux-next
Merging xfs/master
Merging vfs/for-next
Merging vfs-scale/vfs-scale-working
Merging pci/linux-next
Merging of-pci/of-pci
Merging hid/for-next
Merging quilt/i2c
Merging bjdooks-i2c/next-i2c
Merging quilt/jdelvare-hwmon
Merging hwmon-staging/hwmon-next
Merging quilt/kernel-doc
Merging docs/docs-move
Merging v4l-dvb/master
Merging kbuild/for-next
Merging kconfig/for-next
Merging ide/master
Merging libata/NEXT
Merging infiniband/for-next
Merging acpi/test
Merging idle-test/idle-test
Merging powertools/tools-test
Merging cpupowerutils/master
Merging ieee1394/for-next
Merging ubi/linux-next
Merging dlm/next
Merging swiotlb/master
Merging ibft/master
Merging scsi/master
Merging iscsi-target/for-next
Merging slave-dma/next
Merging async_tx/next
Merging net/master
Merging wireless/master
Merging bluetooth/master
Merging mtd/master
Merging l2-mtd/master
CONFLICT (content): Merge conflict in drivers/mtd/maps/lantiq-flash.c
CONFLICT (content): Merge conflict in drivers/mtd/maps/pxa2xx-flash.c
Merging crypto/master
Merging sound/for-next
Merging sound-asoc/for-next
Merging cpufreq/next
Merging quilt/rr
Merging input/next
Merging input-mt/next
Merging lsm/for-next
Merging block/for-next
Merging quilt/device-mapper
Merging embedded/master
Merging firmware/master
Merging pcmcia/master
Merging battery/master
Merging leds/for-mm
CONFLICT (content): Merge conflict in drivers/leds/Kconfig
Merging backlight/for-mm
Merging mmc/mmc-next
CONFLICT (content): Merge conflict in drivers/mmc/host/sdhci-esdhc-imx.c
Merging kgdb/kgdb-next
Merging slab/for-next
Merging uclinux/for-next
Merging md/for-next
Merging mfd/for-next
Merging hdlc/hdlc-next
Merging drm/drm-next
Merging fbdev/master
Merging viafb/viafb-next
Merging omap_dss2/for-next
Merging voltage/for-next
Merging security-testing/next
Merging selinux/master
Merging lblnet/master
Merging agp/agp-next
Merging watchdog/master
CONFLICT (content): Merge conflict in drivers/watchdog/nv_tco.c
Merging bdev/master
Merging dwmw2-iommu/master
Merging cputime/cputime
Merging osd/linux-next
Merging jc_docs/docs-next
Merging nommu/master
Merging trivial/for-next
Merging audit/for-next
Merging suspend/linux-next
Merging apm/for-next
Merging fsnotify/for-next
Merging irda/for-next
Merging i7core_edac/linux_next
Merging i7300_edac/linux_next
Merging devicetree/devicetree/next
Merging spi/spi/next
Merging gpio/gpio/next
Merging tip/auto-latest
Merging rcu/rcu/next
Merging kvm/linux-next
Merging oprofile/for-next
Merging ptrace/ptrace
Merging xen/upstream/xen
Merging xen-two/linux-next
Merging xen-pvhvm/linux-next
Merging edac-amd/for-next
Merging percpu/for-next
Merging workqueues/for-next
Merging sfi/sfi-test
Merging asm-generic/next
Merging drivers-x86/linux-next
CONFLICT (content): Merge conflict in Documentation/feature-removal-schedule.txt
Merging hwpoison/hwpoison
Merging sysctl/master
Merging namespace/master
Merging regmap/for-next
Merging driver-core/driver-core-next
Merging tty/tty-next
Merging usb/usb-next
Merging staging/staging-next
Merging bkl-config/config
Merging tmem/linux-next
Merging writeback/next
Merging arm-dt/devicetree/arm-next
Merging scsi-post-merge/merge-base:master
Merging moduleh/module.h-split
CONFLICT (content): Merge conflict in drivers/dma/ste_dma40.c
CONFLICT (content): Merge conflict in drivers/staging/dt3155v4l/dt3155v4l.c
Applying: dm: use export.h instead of module.h where possible
Applying: block: bsg-lib.c needs export.h not module.h
Applying: power: max8998_charger.c needs module.h
Applying: regulator: aat2870 needs module.h
Applying: power_supply: max8997_charger.c need to include module.h
$ git checkout akpm
Applying: init_fault_attr_dentries() is used to export fault_attr via debugfs.  But
Applying: As the comment explains, the intention of the code is to clear the
Applying: 1. 26c4caea "don't allow duplicate entries in listener mode"
Applying: When send_cpu_listeners() finds the orphaned listener it marks it as
Applying: The current hyper-optimized functions are overkill if you simply want to
Applying: Fix new kernel-doc warning in fs/dcache.c:
Applying: Expand root=PARTUUID=UUID syntax to support selecting a root partition by
Applying: This patch makes two changes:
Applying: Update kernel-parameters.txt to point users to the authoritative comment
Applying: Update the module parameters when platform data is used.  This means that
Applying: __GFP_OTHER_NODE is used for NUMA allocations on behalf of other nodes.
Applying: On thread exit shm_exit_ns() is called, it uses shm_ids(ns).rw_mutex.  It
Applying: Because of x86-implement-strict-user-copy-checks-for-x86_64.patch
Applying: When no floppy is found the module code can be released while a timer
Applying: kernel/fork.c:267: error: implicit declaration of function
Applying: arch/cris/arch-v10/drivers/sync_serial.c:628: error: 'ret' undeclared (first use in this function)
Applying: arch/cris/arch-v10/drivers/sync_serial.c:961: error: conflicting types for 'sync_serial_ioctl'
Applying: arch/cris/arch-v10/kernel/irq.c:239: error: implicit declaration of function 'kgdb_init'
Applying: lockdep_init_map() only initializes parts of lockdep_map and triggers
Applying: The parameter's origin type is long.  On an i386 architecture, it can
Applying: Add support for Aspire 1410 BIOS v1.3314.  Fixes the following error:
Applying: This makes the iris driver use the platform API, so it is properly exposed
Applying: On x86_32 casting the unsigned int result of get_random_int() to long may
Applying: This new driver replaces the old PCEngines Alix 2/3 LED driver with a new
Applying: Cc: Ed Wildgoose <git@wildgooses.com>
Applying: Replace the bubble sort in sanitize_e820_map() with a call to the generic
Applying: The x86 timer interrupt handler is the only handler not traced in the
Applying: The current interrupt traces from irq_handler_entry and irq_handler_exit
Applying: Don't allow everybody to use a modem.
Applying: The address limit is already set in flush_old_exec() so this
Applying: A call to va_copy() should always be followed by a call to va_end() in the
Applying: Don't dereference em if it's NULL or an error pointer.
Applying: When doing a single register write we use work_buf for both the register
Applying: Some messing with error codes to return 0 on out id's and match
Applying: fb_set_suspend() must be called with the console semaphore held, which
Applying: hwmon was using an idr with a NULL pointer, so convert to an
Applying: A straightforward looking use of idr for a device id.
Applying: Unless I'm very much missing something these tests are intended to check
Applying: The address limit is already set in flush_old_exec() so this
Applying: The address limit is already set in flush_old_exec() so this
Applying: backlight_device_register() returns ERR_PTR() on error.
Applying: 1. current implementation tests wrong value for setting aat2870_bl->max_current.
Applying: i386 allmodconfig:
Applying: Add new check (assert_init) to make sure objects are initialized and
Applying: del_timer_sync() calls debug_object_assert_init() to assert that a timer
Applying: ext4_{set,clear}_bit() is defined as __test_and_{set,clear}_bit_le() for
Applying: The dqc_bitmap field of struct ocfs2_local_disk_chunk is 32-bit aligned,
Applying: The address limit is already set in flush_old_exec() so those calls to
Applying: When do pci remove/rescan on system that have more iommus, got
Applying: The current implementation of dmi_name_in_vendors() is an invitation to
Applying: The address limit is already set in flush_old_exec() so those calls to
Applying: For headers that get exported to userland and make use of u32 style
Applying: Fix sparse warnings of right shift bigger than source value size:
Applying: We leak in drivers/scsi/aacraid/commctrl.c::aac_send_raw_srb() :
Applying: Some mangling of errors was necessary to maintain current interface.
Applying: This does involve additional use of the spin lock in idr.c.  Is this an
Applying: Instead of open coding this function use kstrtoul_from_user() directly.
Applying: brd_make_request() always returns 0, which doesn't make much sense.
Applying: The address limit is already set in flush_old_exec() so this assignment of
Applying: The basic idea behind cross memory attach is to allow MPI programs doing
Applying: - Add x86_64 specific wire up
Applying: acct_isolated of compaction uses page_lru_base_type which returns only
Applying: Change ISOLATE_XXX macro with bitwise isolate_mode_t type.  Normally,
Applying: In async mode, compaction doesn't migrate dirty or writeback pages.  So,
Applying: In __zone_reclaim case, we don't want to shrink mapped page.  Nonetheless,
Applying: unmap_and_move() is one a big messy function.  Clean it up.
Applying: radix_tree_tag_get()'s BUG (when it sees a tag after saw_unset_tag) was
Applying: per-task block plug can reduce block queue lock contention and increase
Applying: The tracing ring-buffer used this function briefly, but not anymore.
Applying: After selecting a task to kill, the oom killer iterates all processes and
Applying: A patchset to extend tmpfs to MAX_LFS_FILESIZE by abandoning its peculiar
Applying: If swap entries are to be stored along with struct page pointers in a
Applying: The maximum size of a shmem/tmpfs file has been limited by the maximum
Applying: While it's at its least, make a number of boring nitpicky cleanups to
Applying: Bring truncate.c's code for truncate_inode_pages_range() inline into
Applying: Disable the toy swapping implementation in shmem_writepage() - it's hard
Applying: Convert shmem_unuse_inode() to use a lockless gang lookup of the radix
Applying: Convert shmem_getpage_gfp(), the engine-room of shmem, to expect page or
Applying: Remove mem_cgroup_shmem_charge_fallback(): it was only required when we
Applying: Convert shmem_writepage() to use shmem_delete_from_page_cache() to use
Applying: But we've not yet removed the old swp_entry_t i_direct[16] from
Applying: Remove PageSwapBacked (!page_is_file_cache) cases from
Applying: Fix NULL dereference I introduced in mincore_page().
Applying: We have already acknowledged that swapoff of a tmpfs file is slower than
Applying: Make the radix_tree exceptional cases, mostly in filemap.c, clearer.
Applying: Expand the fs/Kconfig "help" info to clarify why it's a bad idea to
Applying: Expand the fs/Kconfig "help" info to clarify why you might need to select
Applying: Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Applying: The current implementation of the /dev/hpet driver couples opening the
Applying: smp_call_function() only lets all other CPUs execute a specific function,
Applying: auto_demotion_disable is called only for online CPUs.  For hotplugged
Applying: Enabling DEBUG_STRICT_USER_COPY_CHECKS causes the following warning:
Applying: Strict user copy checks are only really supported on x86_32 even though
Applying: The help text for this config is duplicated across the x86, parisc, and
Applying: s/lib-/obj-/ for usercopy.o
Applying: After an "unexpected" reboot, I found this Oops in my logs:
Applying: In the move of the lis3 driver, the hp_accel.c file got dropped from the
Applying: Add axis correction for HP EliteBook 2730p.
Applying: Add axis correction for HP EliteBook 8540w.
Applying: Add axis correction for HP ProBook 6555b.
Applying: Adapt the help text for CONFIG_HP_ACCEL to the move of
Applying: Signed-off-by: Ilkka Koskinen <ilkka.koskinen@nokia.com>
Applying: Signed-off-by: Ilkka Koskinen <ilkka.koskinen@nokia.com>
Applying: Change exported functions to use the device given as parameter
Applying: Signed-off-by: Ilkka Koskinen <ilkka.koskinen@nokia.com>
Applying: Add V2 of the LED driver for a single timer channel for the TPU hardware
Applying: Add support for slice by 8 to existing crc32 algorithm.  Also modify
Applying: don't include asm/msr.h
Applying: This is the one use of an ida that doesn't retry on receiving -EAGAIN.
Applying: One can get this information from minix/inode.c, but adding the
Applying: Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Applying: Force this on for -next/mm testing purposes.
Applying: Add a proc_dointvec_bool() sysctl handler for cases where the input value
Applying: Use the new proc_do_intvec_bool() handler for various boolean inputs.
Applying: Add a proc_dointvec_unsigned() sysctl handler for positive value cases.
Applying: Cc: Alexey Dobriyan <adobriyan@gmail.com>
Applying: Use the new proc_do_intvec_unsigned() handler for various unsigned inputs.
Applying: A default echo function has been provided so it is no longer an error when
Applying: This client driver allows you to use a GPIO pin as a source for PPS
Applying: remove unneeded cast of void*
Applying: Straightforward.  As an aside, the ida_init calls are not needed as far as
Merging akpm
Applying: fault-injection-add-ability-to-export-fault_attr-in-arbitrary-directory-fix
[master eb0d47f] Revert "dt: add of_alias_scan and of_alias_get_id"

[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]

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

* Re: linux-next: Tree for Aug 4 (zcache)
  2011-08-04  4:58 linux-next: Tree for Aug 4 Stephen Rothwell
@ 2011-08-04 21:24 ` Randy Dunlap
  2011-08-04 21:44   ` Greg KH
  2011-08-04 22:22   ` Randy Dunlap
  1 sibling, 1 reply; 41+ messages in thread
From: Randy Dunlap @ 2011-08-04 21:24 UTC (permalink / raw)
  To: Stephen Rothwell, Dan Magenheimer
  Cc: linux-next, LKML, Nitin Gupta, driverdevel,
	Thadeu Lima de Souza Cascardo

On Thu, 4 Aug 2011 14:58:34 +1000 Stephen Rothwell wrote:

> Hi all,
> 
> Just in case anyone needs reminding:  Please do not add anything destined
> for v3.2 into linux-next included trees until after v3.1-rc1.


on i386:

drivers/built-in.o: In function `zcache_pampd_create':
zcache-main.c:(.text+0x159b8f): undefined reference to `__udivdi3'

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

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

* Re: linux-next: Tree for Aug 4 (zcache)
  2011-08-04 21:24 ` linux-next: Tree for Aug 4 (zcache) Randy Dunlap
@ 2011-08-04 21:44   ` Greg KH
  2011-08-04 21:51     ` Randy Dunlap
  0 siblings, 1 reply; 41+ messages in thread
From: Greg KH @ 2011-08-04 21:44 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: Stephen Rothwell, Dan Magenheimer, driverdevel,
	Thadeu Lima de Souza Cascardo, linux-next, LKML, Nitin Gupta

On Thu, Aug 04, 2011 at 02:24:37PM -0700, Randy Dunlap wrote:
> On Thu, 4 Aug 2011 14:58:34 +1000 Stephen Rothwell wrote:
> 
> > Hi all,
> > 
> > Just in case anyone needs reminding:  Please do not add anything destined
> > for v3.2 into linux-next included trees until after v3.1-rc1.
> 
> 
> on i386:
> 
> drivers/built-in.o: In function `zcache_pampd_create':
> zcache-main.c:(.text+0x159b8f): undefined reference to `__udivdi3'

Very wierd, what would cause that?

greg k-h

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

* Re: linux-next: Tree for Aug 4 (zcache)
  2011-08-04 21:44   ` Greg KH
@ 2011-08-04 21:51     ` Randy Dunlap
  2011-08-04 21:54         ` Thadeu Lima de Souza Cascardo
  2011-08-04 22:00       ` [PATCH] zcache: Use div_u64 for 64-bit division Thadeu Lima de Souza Cascardo
  0 siblings, 2 replies; 41+ messages in thread
From: Randy Dunlap @ 2011-08-04 21:51 UTC (permalink / raw)
  To: Greg KH
  Cc: Stephen Rothwell, Dan Magenheimer, driverdevel,
	Thadeu Lima de Souza Cascardo, linux-next, LKML, Nitin Gupta

On Thu, 4 Aug 2011 14:44:41 -0700 Greg KH wrote:

> On Thu, Aug 04, 2011 at 02:24:37PM -0700, Randy Dunlap wrote:
> > On Thu, 4 Aug 2011 14:58:34 +1000 Stephen Rothwell wrote:
> > 
> > > Hi all,
> > > 
> > > Just in case anyone needs reminding:  Please do not add anything destined
> > > for v3.2 into linux-next included trees until after v3.1-rc1.
> > 
> > 
> > on i386:
> > 
> > drivers/built-in.o: In function `zcache_pampd_create':
> > zcache-main.c:(.text+0x159b8f): undefined reference to `__udivdi3'
> 
> Very wierd, what would cause that?

I don't see what's weird about it.

Probably one of these divisions:

		if (curr_pers_pampd_count >
		    (zv_page_count_policy_percent * totalram_pages) / 100)
			goto out;

or

			zv_mean_zsize = xv_get_total_size_bytes(cli->xvpool) /
						curr_pers_pampd_count;


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

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

* Re: linux-next: Tree for Aug 4 (zcache)
  2011-08-04 21:51     ` Randy Dunlap
@ 2011-08-04 21:54         ` Thadeu Lima de Souza Cascardo
  2011-08-04 22:00       ` [PATCH] zcache: Use div_u64 for 64-bit division Thadeu Lima de Souza Cascardo
  1 sibling, 0 replies; 41+ messages in thread
From: Thadeu Lima de Souza Cascardo @ 2011-08-04 21:54 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: Greg KH, Stephen Rothwell, Dan Magenheimer, driverdevel,
	linux-next, LKML, Nitin Gupta

[-- Attachment #1: Type: text/plain, Size: 1167 bytes --]

On Thu, Aug 04, 2011 at 02:51:45PM -0700, Randy Dunlap wrote:
> On Thu, 4 Aug 2011 14:44:41 -0700 Greg KH wrote:
> 
> > On Thu, Aug 04, 2011 at 02:24:37PM -0700, Randy Dunlap wrote:
> > > On Thu, 4 Aug 2011 14:58:34 +1000 Stephen Rothwell wrote:
> > > 
> > > > Hi all,
> > > > 
> > > > Just in case anyone needs reminding:  Please do not add anything destined
> > > > for v3.2 into linux-next included trees until after v3.1-rc1.
> > > 
> > > 
> > > on i386:
> > > 
> > > drivers/built-in.o: In function `zcache_pampd_create':
> > > zcache-main.c:(.text+0x159b8f): undefined reference to `__udivdi3'
> > 
> > Very wierd, what would cause that?
> 
> I don't see what's weird about it.
> 
> Probably one of these divisions:
> 
> 		if (curr_pers_pampd_count >
> 		    (zv_page_count_policy_percent * totalram_pages) / 100)
> 			goto out;
> 
> or
> 
> 			zv_mean_zsize = xv_get_total_size_bytes(cli->xvpool) /
> 						curr_pers_pampd_count;
> 

The second one. xv_get_total_size_bytes returns u64. I am just
compile-testing a fix.

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


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: linux-next: Tree for Aug 4 (zcache)
@ 2011-08-04 21:54         ` Thadeu Lima de Souza Cascardo
  0 siblings, 0 replies; 41+ messages in thread
From: Thadeu Lima de Souza Cascardo @ 2011-08-04 21:54 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: driverdevel, Stephen Rothwell, Dan Magenheimer, LKML, linux-next,
	Nitin Gupta


[-- Attachment #1.1: Type: text/plain, Size: 1167 bytes --]

On Thu, Aug 04, 2011 at 02:51:45PM -0700, Randy Dunlap wrote:
> On Thu, 4 Aug 2011 14:44:41 -0700 Greg KH wrote:
> 
> > On Thu, Aug 04, 2011 at 02:24:37PM -0700, Randy Dunlap wrote:
> > > On Thu, 4 Aug 2011 14:58:34 +1000 Stephen Rothwell wrote:
> > > 
> > > > Hi all,
> > > > 
> > > > Just in case anyone needs reminding:  Please do not add anything destined
> > > > for v3.2 into linux-next included trees until after v3.1-rc1.
> > > 
> > > 
> > > on i386:
> > > 
> > > drivers/built-in.o: In function `zcache_pampd_create':
> > > zcache-main.c:(.text+0x159b8f): undefined reference to `__udivdi3'
> > 
> > Very wierd, what would cause that?
> 
> I don't see what's weird about it.
> 
> Probably one of these divisions:
> 
> 		if (curr_pers_pampd_count >
> 		    (zv_page_count_policy_percent * totalram_pages) / 100)
> 			goto out;
> 
> or
> 
> 			zv_mean_zsize = xv_get_total_size_bytes(cli->xvpool) /
> 						curr_pers_pampd_count;
> 

The second one. xv_get_total_size_bytes returns u64. I am just
compile-testing a fix.

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


[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel

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

* [PATCH] zcache: Use div_u64 for 64-bit division
  2011-08-04 21:51     ` Randy Dunlap
  2011-08-04 21:54         ` Thadeu Lima de Souza Cascardo
@ 2011-08-04 22:00       ` Thadeu Lima de Souza Cascardo
  2011-08-04 22:17         ` Randy Dunlap
  1 sibling, 1 reply; 41+ messages in thread
From: Thadeu Lima de Souza Cascardo @ 2011-08-04 22:00 UTC (permalink / raw)
  To: linux-next
  Cc: Thadeu Lima de Souza Cascardo, Stephen Rothwell, Dan Magenheimer,
	Nitin Gupta, Greg KH, driverdevel, LKML

xv_get_total_size_bytes returns a u64 value and it's used in a division.
This causes build failures in 32-bit architectures, as reported by Randy
Dunlap.

Reported-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Dan Magenheimer <dan.magenheimer@oracle.com>
Cc: Nitin Gupta <ngupta@vflare.org>
Cc: Greg KH <greg@kroah.com>
Cc: driverdevel <devel@driverdev.osuosl.org>
Cc: linux-next@vger.kernel.org
Cc: LKML <linux-kernel@vger.kernel.org>
---
 drivers/staging/zcache/zcache-main.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/zcache/zcache-main.c b/drivers/staging/zcache/zcache-main.c
index 66469ac..2c41c44 100644
--- a/drivers/staging/zcache/zcache-main.c
+++ b/drivers/staging/zcache/zcache-main.c
@@ -28,6 +28,7 @@
 #include <linux/spinlock.h>
 #include <linux/types.h>
 #include <linux/atomic.h>
+#include <linux/math64.h>
 #include "tmem.h"
 
 #include "../zram/xvmalloc.h" /* if built in drivers/staging */
@@ -1162,6 +1163,7 @@ static void *zcache_pampd_create(char *data, size_t size, bool raw, int eph,
 	uint16_t client_id = get_client_id_from_client(cli);
 	unsigned long zv_mean_zsize;
 	unsigned long curr_pers_pampd_count;
+	u64 total_zsize;
 
 	if (eph) {
 		ret = zcache_compress(page, &cdata, &clen);
@@ -1194,8 +1196,9 @@ static void *zcache_pampd_create(char *data, size_t size, bool raw, int eph,
 		}
 		/* reject if mean compression is too poor */
 		if ((clen > zv_max_mean_zsize) && (curr_pers_pampd_count > 0)) {
-			zv_mean_zsize = xv_get_total_size_bytes(cli->xvpool) /
-						curr_pers_pampd_count;
+			total_zsize = xv_get_total_size_bytes(cli->xvpool);
+			zv_mean_zsize = div_u64(total_zsize,
+						curr_pers_pampd_count);
 			if (zv_mean_zsize > zv_max_mean_zsize) {
 				zcache_mean_compress_poor++;
 				goto out;
-- 
1.7.5.4


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

* Re: [PATCH] zcache: Use div_u64 for 64-bit division
  2011-08-04 22:00       ` [PATCH] zcache: Use div_u64 for 64-bit division Thadeu Lima de Souza Cascardo
@ 2011-08-04 22:17         ` Randy Dunlap
  0 siblings, 0 replies; 41+ messages in thread
From: Randy Dunlap @ 2011-08-04 22:17 UTC (permalink / raw)
  To: Thadeu Lima de Souza Cascardo
  Cc: linux-next, Stephen Rothwell, Dan Magenheimer, Nitin Gupta,
	Greg KH, driverdevel, LKML

On Thu,  4 Aug 2011 19:00:33 -0300 Thadeu Lima de Souza Cascardo wrote:

> xv_get_total_size_bytes returns a u64 value and it's used in a division.
> This causes build failures in 32-bit architectures, as reported by Randy
> Dunlap.
> 
> Reported-by: Randy Dunlap <rdunlap@xenotime.net>
> Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
> Cc: Stephen Rothwell <sfr@canb.auug.org.au>
> Cc: Dan Magenheimer <dan.magenheimer@oracle.com>
> Cc: Nitin Gupta <ngupta@vflare.org>
> Cc: Greg KH <greg@kroah.com>
> Cc: driverdevel <devel@driverdev.osuosl.org>
> Cc: linux-next@vger.kernel.org
> Cc: LKML <linux-kernel@vger.kernel.org>

Acked-by: Randy Dunlap <rdunlap@xenotime.net>

Thanks.

> ---
>  drivers/staging/zcache/zcache-main.c |    7 +++++--
>  1 files changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/zcache/zcache-main.c b/drivers/staging/zcache/zcache-main.c
> index 66469ac..2c41c44 100644
> --- a/drivers/staging/zcache/zcache-main.c
> +++ b/drivers/staging/zcache/zcache-main.c
> @@ -28,6 +28,7 @@
>  #include <linux/spinlock.h>
>  #include <linux/types.h>
>  #include <linux/atomic.h>
> +#include <linux/math64.h>
>  #include "tmem.h"
>  
>  #include "../zram/xvmalloc.h" /* if built in drivers/staging */
> @@ -1162,6 +1163,7 @@ static void *zcache_pampd_create(char *data, size_t size, bool raw, int eph,
>  	uint16_t client_id = get_client_id_from_client(cli);
>  	unsigned long zv_mean_zsize;
>  	unsigned long curr_pers_pampd_count;
> +	u64 total_zsize;
>  
>  	if (eph) {
>  		ret = zcache_compress(page, &cdata, &clen);
> @@ -1194,8 +1196,9 @@ static void *zcache_pampd_create(char *data, size_t size, bool raw, int eph,
>  		}
>  		/* reject if mean compression is too poor */
>  		if ((clen > zv_max_mean_zsize) && (curr_pers_pampd_count > 0)) {
> -			zv_mean_zsize = xv_get_total_size_bytes(cli->xvpool) /
> -						curr_pers_pampd_count;
> +			total_zsize = xv_get_total_size_bytes(cli->xvpool);
> +			zv_mean_zsize = div_u64(total_zsize,
> +						curr_pers_pampd_count);
>  			if (zv_mean_zsize > zv_max_mean_zsize) {
>  				zcache_mean_compress_poor++;
>  				goto out;
> -- 


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

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

* [PATCH -next] drivers/base/inode.c: let vmstat_text be optional
  2011-08-04  4:58 linux-next: Tree for Aug 4 Stephen Rothwell
@ 2011-08-04 22:22   ` Randy Dunlap
  2011-08-04 22:22   ` Randy Dunlap
  1 sibling, 0 replies; 41+ messages in thread
From: Randy Dunlap @ 2011-08-04 22:22 UTC (permalink / raw)
  To: Stephen Rothwell, Amerigo Wang, gregkh; +Cc: linux-next, LKML, linux-mm, akpm

From: Randy Dunlap <rdunlap@xenotime.net>

vmstat_text is only available when PROC_FS or SYSFS is enabled.
This causes build errors in drivers/base/node.c when they are
both disabled:

drivers/built-in.o: In function `node_read_vmstat':
node.c:(.text+0x10e28f): undefined reference to `vmstat_text'

Rather than litter drivers/base/node.c with #ifdef/#endif around
the affected lines of code, add macros for optional sysdev
attributes so that those lines of code will be ignored, without
using #ifdef/#endif in the .c file(s).  I.e., the ifdeffery
is done only in a header file with sysdev_create_file_optional()
and sysdev_remove_file_optional().

Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
---
 drivers/base/node.c    |    6 ++++--
 include/linux/sysdev.h |   14 ++++++++++++++
 include/linux/vmstat.h |    2 ++
 3 files changed, 20 insertions(+), 2 deletions(-)

--- linux-next-20110804.orig/include/linux/vmstat.h
+++ linux-next-20110804/include/linux/vmstat.h
@@ -258,6 +258,8 @@ static inline void refresh_zone_stat_thr
 
 #endif		/* CONFIG_SMP */
 
+#if defined(CONFIG_PROC_FS) || defined(CONFIG_SYSFS)
 extern const char * const vmstat_text[];
+#endif
 
 #endif /* _LINUX_VMSTAT_H */
--- linux-next-20110804.orig/drivers/base/node.c
+++ linux-next-20110804/drivers/base/node.c
@@ -176,6 +176,7 @@ static ssize_t node_read_numastat(struct
 }
 static SYSDEV_ATTR(numastat, S_IRUGO, node_read_numastat, NULL);
 
+#if defined(CONFIG_PROC_FS) || defined(CONFIG_SYSFS)
 static ssize_t node_read_vmstat(struct sys_device *dev,
 				struct sysdev_attribute *attr, char *buf)
 {
@@ -190,6 +191,7 @@ static ssize_t node_read_vmstat(struct s
 	return n;
 }
 static SYSDEV_ATTR(vmstat, S_IRUGO, node_read_vmstat, NULL);
+#endif
 
 static ssize_t node_read_distance(struct sys_device * dev,
 			struct sysdev_attribute *attr, char * buf)
@@ -274,7 +276,7 @@ int register_node(struct node *node, int
 		sysdev_create_file(&node->sysdev, &attr_meminfo);
 		sysdev_create_file(&node->sysdev, &attr_numastat);
 		sysdev_create_file(&node->sysdev, &attr_distance);
-		sysdev_create_file(&node->sysdev, &attr_vmstat);
+		sysdev_create_file_optional(&node->sysdev, &attr_vmstat);
 
 		scan_unevictable_register_node(node);
 
@@ -299,7 +301,7 @@ void unregister_node(struct node *node)
 	sysdev_remove_file(&node->sysdev, &attr_meminfo);
 	sysdev_remove_file(&node->sysdev, &attr_numastat);
 	sysdev_remove_file(&node->sysdev, &attr_distance);
-	sysdev_remove_file(&node->sysdev, &attr_vmstat);
+	sysdev_remove_file_optional(&node->sysdev, &attr_vmstat);
 
 	scan_unevictable_unregister_node(node);
 	hugetlb_unregister_node(node);		/* no-op, if memoryless node */
--- linux-next-20110804.orig/include/linux/sysdev.h
+++ linux-next-20110804/include/linux/sysdev.h
@@ -114,6 +114,20 @@ struct sysdev_attribute { 
 extern int sysdev_create_file(struct sys_device *, struct sysdev_attribute *);
 extern void sysdev_remove_file(struct sys_device *, struct sysdev_attribute *);
 
+#if defined(CONFIG_PROC_FS) || defined(CONFIG_SYSFS)
+#define sysdev_create_file_optional(sysdev, sysdevattr)	\
+	return sysdev_create_file(sysdev, sysdevattr);
+
+#define sysdev_remove_file_optional(sysdev, sysdevattr)	\
+		sysdev_remove_file(sysdev, sysdevattr);
+#else
+#define sysdev_create_file_optional(sysdev, sysdevattr)	\
+		(0)
+
+#define sysdev_remove_file_optional(sysdev, sysdevattr)	\
+		do {} while (0)
+#endif
+
 /* Create/remove NULL terminated attribute list */
 static inline int
 sysdev_create_files(struct sys_device *d, struct sysdev_attribute **a)

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

* [PATCH -next] drivers/base/inode.c: let vmstat_text be optional
@ 2011-08-04 22:22   ` Randy Dunlap
  0 siblings, 0 replies; 41+ messages in thread
From: Randy Dunlap @ 2011-08-04 22:22 UTC (permalink / raw)
  To: Stephen Rothwell, Amerigo Wang, gregkh; +Cc: linux-next, LKML, linux-mm, akpm

From: Randy Dunlap <rdunlap@xenotime.net>

vmstat_text is only available when PROC_FS or SYSFS is enabled.
This causes build errors in drivers/base/node.c when they are
both disabled:

drivers/built-in.o: In function `node_read_vmstat':
node.c:(.text+0x10e28f): undefined reference to `vmstat_text'

Rather than litter drivers/base/node.c with #ifdef/#endif around
the affected lines of code, add macros for optional sysdev
attributes so that those lines of code will be ignored, without
using #ifdef/#endif in the .c file(s).  I.e., the ifdeffery
is done only in a header file with sysdev_create_file_optional()
and sysdev_remove_file_optional().

Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
---
 drivers/base/node.c    |    6 ++++--
 include/linux/sysdev.h |   14 ++++++++++++++
 include/linux/vmstat.h |    2 ++
 3 files changed, 20 insertions(+), 2 deletions(-)

--- linux-next-20110804.orig/include/linux/vmstat.h
+++ linux-next-20110804/include/linux/vmstat.h
@@ -258,6 +258,8 @@ static inline void refresh_zone_stat_thr
 
 #endif		/* CONFIG_SMP */
 
+#if defined(CONFIG_PROC_FS) || defined(CONFIG_SYSFS)
 extern const char * const vmstat_text[];
+#endif
 
 #endif /* _LINUX_VMSTAT_H */
--- linux-next-20110804.orig/drivers/base/node.c
+++ linux-next-20110804/drivers/base/node.c
@@ -176,6 +176,7 @@ static ssize_t node_read_numastat(struct
 }
 static SYSDEV_ATTR(numastat, S_IRUGO, node_read_numastat, NULL);
 
+#if defined(CONFIG_PROC_FS) || defined(CONFIG_SYSFS)
 static ssize_t node_read_vmstat(struct sys_device *dev,
 				struct sysdev_attribute *attr, char *buf)
 {
@@ -190,6 +191,7 @@ static ssize_t node_read_vmstat(struct s
 	return n;
 }
 static SYSDEV_ATTR(vmstat, S_IRUGO, node_read_vmstat, NULL);
+#endif
 
 static ssize_t node_read_distance(struct sys_device * dev,
 			struct sysdev_attribute *attr, char * buf)
@@ -274,7 +276,7 @@ int register_node(struct node *node, int
 		sysdev_create_file(&node->sysdev, &attr_meminfo);
 		sysdev_create_file(&node->sysdev, &attr_numastat);
 		sysdev_create_file(&node->sysdev, &attr_distance);
-		sysdev_create_file(&node->sysdev, &attr_vmstat);
+		sysdev_create_file_optional(&node->sysdev, &attr_vmstat);
 
 		scan_unevictable_register_node(node);
 
@@ -299,7 +301,7 @@ void unregister_node(struct node *node)
 	sysdev_remove_file(&node->sysdev, &attr_meminfo);
 	sysdev_remove_file(&node->sysdev, &attr_numastat);
 	sysdev_remove_file(&node->sysdev, &attr_distance);
-	sysdev_remove_file(&node->sysdev, &attr_vmstat);
+	sysdev_remove_file_optional(&node->sysdev, &attr_vmstat);
 
 	scan_unevictable_unregister_node(node);
 	hugetlb_unregister_node(node);		/* no-op, if memoryless node */
--- linux-next-20110804.orig/include/linux/sysdev.h
+++ linux-next-20110804/include/linux/sysdev.h
@@ -114,6 +114,20 @@ struct sysdev_attribute { 
 extern int sysdev_create_file(struct sys_device *, struct sysdev_attribute *);
 extern void sysdev_remove_file(struct sys_device *, struct sysdev_attribute *);
 
+#if defined(CONFIG_PROC_FS) || defined(CONFIG_SYSFS)
+#define sysdev_create_file_optional(sysdev, sysdevattr)	\
+	return sysdev_create_file(sysdev, sysdevattr);
+
+#define sysdev_remove_file_optional(sysdev, sysdevattr)	\
+		sysdev_remove_file(sysdev, sysdevattr);
+#else
+#define sysdev_create_file_optional(sysdev, sysdevattr)	\
+		(0)
+
+#define sysdev_remove_file_optional(sysdev, sysdevattr)	\
+		do {} while (0)
+#endif
+
 /* Create/remove NULL terminated attribute list */
 static inline int
 sysdev_create_files(struct sys_device *d, struct sysdev_attribute **a)

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [PATCH -next] drivers/base/inode.c: let vmstat_text be optional
  2011-08-04 22:22   ` Randy Dunlap
  (?)
@ 2011-08-05  2:38     ` Cong Wang
  -1 siblings, 0 replies; 41+ messages in thread
From: Cong Wang @ 2011-08-05  2:38 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: Stephen Rothwell, gregkh, linux-next, LKML, linux-mm, akpm

于 2011年08月05日 06:22, Randy Dunlap 写道:
> From: Randy Dunlap<rdunlap@xenotime.net>
>
> vmstat_text is only available when PROC_FS or SYSFS is enabled.
> This causes build errors in drivers/base/node.c when they are
> both disabled:
>
> drivers/built-in.o: In function `node_read_vmstat':
> node.c:(.text+0x10e28f): undefined reference to `vmstat_text'
>
> Rather than litter drivers/base/node.c with #ifdef/#endif around
> the affected lines of code, add macros for optional sysdev
> attributes so that those lines of code will be ignored, without
> using #ifdef/#endif in the .c file(s).  I.e., the ifdeffery
> is done only in a header file with sysdev_create_file_optional()
> and sysdev_remove_file_optional().
>

This looks ugly for me, because other sysfs files here are not optional
only due to that they don't rely on vmstat_text.

I still think my approach to fix this is better, that is, introducing
a new Kconfig for drivers/base/node.c which depends on CONFIG_SYSFS.

Thanks.

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

* Re: [PATCH -next] drivers/base/inode.c: let vmstat_text be optional
@ 2011-08-05  2:38     ` Cong Wang
  0 siblings, 0 replies; 41+ messages in thread
From: Cong Wang @ 2011-08-05  2:38 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: Stephen Rothwell, gregkh, linux-next, LKML, linux-mm, akpm

于 2011年08月05日 06:22, Randy Dunlap 写道:
> From: Randy Dunlap<rdunlap@xenotime.net>
>
> vmstat_text is only available when PROC_FS or SYSFS is enabled.
> This causes build errors in drivers/base/node.c when they are
> both disabled:
>
> drivers/built-in.o: In function `node_read_vmstat':
> node.c:(.text+0x10e28f): undefined reference to `vmstat_text'
>
> Rather than litter drivers/base/node.c with #ifdef/#endif around
> the affected lines of code, add macros for optional sysdev
> attributes so that those lines of code will be ignored, without
> using #ifdef/#endif in the .c file(s).  I.e., the ifdeffery
> is done only in a header file with sysdev_create_file_optional()
> and sysdev_remove_file_optional().
>

This looks ugly for me, because other sysfs files here are not optional
only due to that they don't rely on vmstat_text.

I still think my approach to fix this is better, that is, introducing
a new Kconfig for drivers/base/node.c which depends on CONFIG_SYSFS.

Thanks.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [PATCH -next] drivers/base/inode.c: let vmstat_text be optional
@ 2011-08-05  2:38     ` Cong Wang
  0 siblings, 0 replies; 41+ messages in thread
From: Cong Wang @ 2011-08-05  2:38 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: Stephen Rothwell, gregkh, linux-next, LKML, linux-mm, akpm

ao? 2011a1'08ae??05ae?JPY 06:22, Randy Dunlap a??e??:
> From: Randy Dunlap<rdunlap@xenotime.net>
>
> vmstat_text is only available when PROC_FS or SYSFS is enabled.
> This causes build errors in drivers/base/node.c when they are
> both disabled:
>
> drivers/built-in.o: In function `node_read_vmstat':
> node.c:(.text+0x10e28f): undefined reference to `vmstat_text'
>
> Rather than litter drivers/base/node.c with #ifdef/#endif around
> the affected lines of code, add macros for optional sysdev
> attributes so that those lines of code will be ignored, without
> using #ifdef/#endif in the .c file(s).  I.e., the ifdeffery
> is done only in a header file with sysdev_create_file_optional()
> and sysdev_remove_file_optional().
>

This looks ugly for me, because other sysfs files here are not optional
only due to that they don't rely on vmstat_text.

I still think my approach to fix this is better, that is, introducing
a new Kconfig for drivers/base/node.c which depends on CONFIG_SYSFS.

Thanks.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [PATCH -next] drivers/base/inode.c: let vmstat_text be optional
  2011-08-05  2:38     ` Cong Wang
@ 2011-08-05  5:43       ` Randy Dunlap
  -1 siblings, 0 replies; 41+ messages in thread
From: Randy Dunlap @ 2011-08-05  5:43 UTC (permalink / raw)
  To: Cong Wang; +Cc: Stephen Rothwell, gregkh, linux-next, LKML, linux-mm, akpm

On 08/04/11 19:38, Cong Wang wrote:
> 于 2011年08月05日 06:22, Randy Dunlap 写道:
>> From: Randy Dunlap<rdunlap@xenotime.net>
>>
>> vmstat_text is only available when PROC_FS or SYSFS is enabled.
>> This causes build errors in drivers/base/node.c when they are
>> both disabled:
>>
>> drivers/built-in.o: In function `node_read_vmstat':
>> node.c:(.text+0x10e28f): undefined reference to `vmstat_text'
>>
>> Rather than litter drivers/base/node.c with #ifdef/#endif around
>> the affected lines of code, add macros for optional sysdev
>> attributes so that those lines of code will be ignored, without
>> using #ifdef/#endif in the .c file(s).  I.e., the ifdeffery
>> is done only in a header file with sysdev_create_file_optional()
>> and sysdev_remove_file_optional().
>>
> 
> This looks ugly for me, because other sysfs files here are not optional
> only due to that they don't rely on vmstat_text.
> 
> I still think my approach to fix this is better, that is, introducing
> a new Kconfig for drivers/base/node.c which depends on CONFIG_SYSFS.

Did you post a patch for that?  I must have missed it.

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

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

* Re: [PATCH -next] drivers/base/inode.c: let vmstat_text be optional
@ 2011-08-05  5:43       ` Randy Dunlap
  0 siblings, 0 replies; 41+ messages in thread
From: Randy Dunlap @ 2011-08-05  5:43 UTC (permalink / raw)
  To: Cong Wang; +Cc: Stephen Rothwell, gregkh, linux-next, LKML, linux-mm, akpm

On 08/04/11 19:38, Cong Wang wrote:
> ao? 2011a1'08ae??05ae?JPY 06:22, Randy Dunlap a??e??:
>> From: Randy Dunlap<rdunlap@xenotime.net>
>>
>> vmstat_text is only available when PROC_FS or SYSFS is enabled.
>> This causes build errors in drivers/base/node.c when they are
>> both disabled:
>>
>> drivers/built-in.o: In function `node_read_vmstat':
>> node.c:(.text+0x10e28f): undefined reference to `vmstat_text'
>>
>> Rather than litter drivers/base/node.c with #ifdef/#endif around
>> the affected lines of code, add macros for optional sysdev
>> attributes so that those lines of code will be ignored, without
>> using #ifdef/#endif in the .c file(s).  I.e., the ifdeffery
>> is done only in a header file with sysdev_create_file_optional()
>> and sysdev_remove_file_optional().
>>
> 
> This looks ugly for me, because other sysfs files here are not optional
> only due to that they don't rely on vmstat_text.
> 
> I still think my approach to fix this is better, that is, introducing
> a new Kconfig for drivers/base/node.c which depends on CONFIG_SYSFS.

Did you post a patch for that?  I must have missed it.

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

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [PATCH -next] drivers/base/inode.c: let vmstat_text be optional
  2011-08-05  5:43       ` Randy Dunlap
  (?)
@ 2011-08-05  8:02         ` Cong Wang
  -1 siblings, 0 replies; 41+ messages in thread
From: Cong Wang @ 2011-08-05  8:02 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: Stephen Rothwell, gregkh, linux-next, LKML, linux-mm, akpm

于 2011年08月05日 13:43, Randy Dunlap 写道:
> On 08/04/11 19:38, Cong Wang wrote:
>> 于 2011年08月05日 06:22, Randy Dunlap 写道:
>>> From: Randy Dunlap<rdunlap@xenotime.net>
>>>
>>> vmstat_text is only available when PROC_FS or SYSFS is enabled.
>>> This causes build errors in drivers/base/node.c when they are
>>> both disabled:
>>>
>>> drivers/built-in.o: In function `node_read_vmstat':
>>> node.c:(.text+0x10e28f): undefined reference to `vmstat_text'
>>>
>>> Rather than litter drivers/base/node.c with #ifdef/#endif around
>>> the affected lines of code, add macros for optional sysdev
>>> attributes so that those lines of code will be ignored, without
>>> using #ifdef/#endif in the .c file(s).  I.e., the ifdeffery
>>> is done only in a header file with sysdev_create_file_optional()
>>> and sysdev_remove_file_optional().
>>>
>>
>> This looks ugly for me, because other sysfs files here are not optional
>> only due to that they don't rely on vmstat_text.
>>
>> I still think my approach to fix this is better, that is, introducing
>> a new Kconfig for drivers/base/node.c which depends on CONFIG_SYSFS.
>
> Did you post a patch for that?  I must have missed it.

Yes, see https://lkml.org/lkml/2011/7/19/31.

I think I need to resend it. :)


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

* Re: [PATCH -next] drivers/base/inode.c: let vmstat_text be optional
@ 2011-08-05  8:02         ` Cong Wang
  0 siblings, 0 replies; 41+ messages in thread
From: Cong Wang @ 2011-08-05  8:02 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: Stephen Rothwell, gregkh, linux-next, LKML, linux-mm, akpm

于 2011年08月05日 13:43, Randy Dunlap 写道:
> On 08/04/11 19:38, Cong Wang wrote:
>> 于 2011年08月05日 06:22, Randy Dunlap 写道:
>>> From: Randy Dunlap<rdunlap@xenotime.net>
>>>
>>> vmstat_text is only available when PROC_FS or SYSFS is enabled.
>>> This causes build errors in drivers/base/node.c when they are
>>> both disabled:
>>>
>>> drivers/built-in.o: In function `node_read_vmstat':
>>> node.c:(.text+0x10e28f): undefined reference to `vmstat_text'
>>>
>>> Rather than litter drivers/base/node.c with #ifdef/#endif around
>>> the affected lines of code, add macros for optional sysdev
>>> attributes so that those lines of code will be ignored, without
>>> using #ifdef/#endif in the .c file(s).  I.e., the ifdeffery
>>> is done only in a header file with sysdev_create_file_optional()
>>> and sysdev_remove_file_optional().
>>>
>>
>> This looks ugly for me, because other sysfs files here are not optional
>> only due to that they don't rely on vmstat_text.
>>
>> I still think my approach to fix this is better, that is, introducing
>> a new Kconfig for drivers/base/node.c which depends on CONFIG_SYSFS.
>
> Did you post a patch for that?  I must have missed it.

Yes, see https://lkml.org/lkml/2011/7/19/31.

I think I need to resend it. :)

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [PATCH -next] drivers/base/inode.c: let vmstat_text be optional
@ 2011-08-05  8:02         ` Cong Wang
  0 siblings, 0 replies; 41+ messages in thread
From: Cong Wang @ 2011-08-05  8:02 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: Stephen Rothwell, gregkh, linux-next, LKML, linux-mm, akpm

ao? 2011a1'08ae??05ae?JPY 13:43, Randy Dunlap a??e??:
> On 08/04/11 19:38, Cong Wang wrote:
>> ao? 2011a1'08ae??05ae?JPY 06:22, Randy Dunlap a??e??:
>>> From: Randy Dunlap<rdunlap@xenotime.net>
>>>
>>> vmstat_text is only available when PROC_FS or SYSFS is enabled.
>>> This causes build errors in drivers/base/node.c when they are
>>> both disabled:
>>>
>>> drivers/built-in.o: In function `node_read_vmstat':
>>> node.c:(.text+0x10e28f): undefined reference to `vmstat_text'
>>>
>>> Rather than litter drivers/base/node.c with #ifdef/#endif around
>>> the affected lines of code, add macros for optional sysdev
>>> attributes so that those lines of code will be ignored, without
>>> using #ifdef/#endif in the .c file(s).  I.e., the ifdeffery
>>> is done only in a header file with sysdev_create_file_optional()
>>> and sysdev_remove_file_optional().
>>>
>>
>> This looks ugly for me, because other sysfs files here are not optional
>> only due to that they don't rely on vmstat_text.
>>
>> I still think my approach to fix this is better, that is, introducing
>> a new Kconfig for drivers/base/node.c which depends on CONFIG_SYSFS.
>
> Did you post a patch for that?  I must have missed it.

Yes, see https://lkml.org/lkml/2011/7/19/31.

I think I need to resend it. :)

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [PATCH -next] drivers/base/inode.c: let vmstat_text be optional
  2011-08-04 22:22   ` Randy Dunlap
@ 2011-08-23 21:39     ` Andrew Morton
  -1 siblings, 0 replies; 41+ messages in thread
From: Andrew Morton @ 2011-08-23 21:39 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: Stephen Rothwell, Amerigo Wang, gregkh, linux-next, LKML, linux-mm


> Subject: [PATCH -next] drivers/base/inode.c: let vmstat_text be optional

The patch-against-next thing always disturbs me.  It implies that the
patch is only needed in linux-next, but often that's wrong.  So I have
to go off and work out what kernel it really is applicable to.

And that's OK, it keeps me healthy.  But two minds are better than one,
and if the originator has already worked this out, they should state it
explicitly, please.

On Thu, 4 Aug 2011 15:22:11 -0700
Randy Dunlap <rdunlap@xenotime.net> wrote:

> From: Randy Dunlap <rdunlap@xenotime.net>
> 
> vmstat_text is only available when PROC_FS or SYSFS is enabled.
> This causes build errors in drivers/base/node.c when they are
> both disabled:
> 
> drivers/built-in.o: In function `node_read_vmstat':
> node.c:(.text+0x10e28f): undefined reference to `vmstat_text'
> 
> Rather than litter drivers/base/node.c with #ifdef/#endif around
> the affected lines of code, add macros for optional sysdev
> attributes so that those lines of code will be ignored, without
> using #ifdef/#endif in the .c file(s).  I.e., the ifdeffery
> is done only in a header file with sysdev_create_file_optional()
> and sysdev_remove_file_optional().
> 
> --- linux-next-20110804.orig/include/linux/vmstat.h
> +++ linux-next-20110804/include/linux/vmstat.h
> @@ -258,6 +258,8 @@ static inline void refresh_zone_stat_thr
>  
>  #endif		/* CONFIG_SMP */
>  
> +#if defined(CONFIG_PROC_FS) || defined(CONFIG_SYSFS)
>  extern const char * const vmstat_text[];
> +#endif
>

The ifdef around the declaration isn't needed, really.  If we remove
it then a build-time error becomes a link-time (or even moddep-time) error,
which is a bit of a pain.  But it's less painful than having ifdefs
around squillions of declarations.



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

* Re: [PATCH -next] drivers/base/inode.c: let vmstat_text be optional
@ 2011-08-23 21:39     ` Andrew Morton
  0 siblings, 0 replies; 41+ messages in thread
From: Andrew Morton @ 2011-08-23 21:39 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: Stephen Rothwell, Amerigo Wang, gregkh, linux-next, LKML, linux-mm


> Subject: [PATCH -next] drivers/base/inode.c: let vmstat_text be optional

The patch-against-next thing always disturbs me.  It implies that the
patch is only needed in linux-next, but often that's wrong.  So I have
to go off and work out what kernel it really is applicable to.

And that's OK, it keeps me healthy.  But two minds are better than one,
and if the originator has already worked this out, they should state it
explicitly, please.

On Thu, 4 Aug 2011 15:22:11 -0700
Randy Dunlap <rdunlap@xenotime.net> wrote:

> From: Randy Dunlap <rdunlap@xenotime.net>
> 
> vmstat_text is only available when PROC_FS or SYSFS is enabled.
> This causes build errors in drivers/base/node.c when they are
> both disabled:
> 
> drivers/built-in.o: In function `node_read_vmstat':
> node.c:(.text+0x10e28f): undefined reference to `vmstat_text'
> 
> Rather than litter drivers/base/node.c with #ifdef/#endif around
> the affected lines of code, add macros for optional sysdev
> attributes so that those lines of code will be ignored, without
> using #ifdef/#endif in the .c file(s).  I.e., the ifdeffery
> is done only in a header file with sysdev_create_file_optional()
> and sysdev_remove_file_optional().
> 
> --- linux-next-20110804.orig/include/linux/vmstat.h
> +++ linux-next-20110804/include/linux/vmstat.h
> @@ -258,6 +258,8 @@ static inline void refresh_zone_stat_thr
>  
>  #endif		/* CONFIG_SMP */
>  
> +#if defined(CONFIG_PROC_FS) || defined(CONFIG_SYSFS)
>  extern const char * const vmstat_text[];
> +#endif
>

The ifdef around the declaration isn't needed, really.  If we remove
it then a build-time error becomes a link-time (or even moddep-time) error,
which is a bit of a pain.  But it's less painful than having ifdefs
around squillions of declarations.


--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* [Patch] numa: introduce CONFIG_NUMA_SYSFS for drivers/base/node.c
  2011-08-23 21:39     ` Andrew Morton
  (?)
@ 2011-08-24  3:34     ` Cong Wang
  2011-08-25  2:14         ` Randy Dunlap
  -1 siblings, 1 reply; 41+ messages in thread
From: Cong Wang @ 2011-08-24  3:34 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Randy Dunlap, Stephen Rothwell, gregkh, linux-next, LKML, linux-mm

[-- Attachment #1: Type: text/plain, Size: 77 bytes --]

Hi, Andrew,

Do you think my patch below is better?

Thanks!

------------->

[-- Attachment #2: numa-depends-on-sysfs.diff --]
[-- Type: text/plain, Size: 1334 bytes --]

Introduce a new Kconfig CONFIG_NUMA_SYSFS for drivers/base/node.c
which just provides sysfs interface, so that when we select
CONFIG_NUMA, we don't have to enable the sysfs interface too.

This by the way fixes a randconfig build error when NUMA && !SYSFS.

Signed-off-by: WANG Cong <amwang@redhat.com>

---
diff --git a/drivers/base/Makefile b/drivers/base/Makefile
index 99a375a..e382338 100644
--- a/drivers/base/Makefile
+++ b/drivers/base/Makefile
@@ -10,7 +10,7 @@ obj-$(CONFIG_HAS_DMA)	+= dma-mapping.o
 obj-$(CONFIG_HAVE_GENERIC_DMA_COHERENT) += dma-coherent.o
 obj-$(CONFIG_ISA)	+= isa.o
 obj-$(CONFIG_FW_LOADER)	+= firmware_class.o
-obj-$(CONFIG_NUMA)	+= node.o
+obj-$(CONFIG_NUMA_SYSFS)	+= node.o
 obj-$(CONFIG_MEMORY_HOTPLUG_SPARSE) += memory.o
 obj-$(CONFIG_SMP)	+= topology.o
 ifeq ($(CONFIG_SYSFS),y)
diff --git a/mm/Kconfig b/mm/Kconfig
index f2f1ca1..77345e7 100644
--- a/mm/Kconfig
+++ b/mm/Kconfig
@@ -340,6 +340,16 @@ choice
 	  benefit.
 endchoice
 
+config NUMA_SYSFS
+	bool "Enable NUMA sysfs interface for user-space"
+	depends on NUMA
+	depends on SYSFS
+	default y
+	help
+	  This enables NUMA sysfs interface, /sys/devices/system/node/*
+	  files, for user-space tools, like numactl. If you have enabled
+	  NUMA, probably you also need this one.
+
 #
 # UP and nommu archs use km based percpu allocator
 #

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

* Re: [Patch] numa: introduce CONFIG_NUMA_SYSFS for drivers/base/node.c
  2011-08-24  3:34     ` [Patch] numa: introduce CONFIG_NUMA_SYSFS for drivers/base/node.c Cong Wang
@ 2011-08-25  2:14         ` Randy Dunlap
  0 siblings, 0 replies; 41+ messages in thread
From: Randy Dunlap @ 2011-08-25  2:14 UTC (permalink / raw)
  To: Cong Wang
  Cc: Andrew Morton, Stephen Rothwell, gregkh, linux-next, LKML, linux-mm

On Wed, 24 Aug 2011 11:34:45 +0800 Cong Wang wrote:

> Hi, Andrew,
> 
> Do you think my patch below is better?

Hi,

This causes build errors for me because node.o is not being built:

arch/x86/built-in.o: In function `topology_init':
topology.c:(.init.text+0x3668): undefined reference to `register_one_node'
drivers/built-in.o: In function `unregister_cpu':
(.text+0x7aecc): undefined reference to `unregister_cpu_under_node'
drivers/built-in.o: In function `register_cpu':
(.cpuinit.text+0xc1): undefined reference to `register_cpu_under_node'


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

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

* Re: [Patch] numa: introduce CONFIG_NUMA_SYSFS for drivers/base/node.c
@ 2011-08-25  2:14         ` Randy Dunlap
  0 siblings, 0 replies; 41+ messages in thread
From: Randy Dunlap @ 2011-08-25  2:14 UTC (permalink / raw)
  To: Cong Wang
  Cc: Andrew Morton, Stephen Rothwell, gregkh, linux-next, LKML, linux-mm

On Wed, 24 Aug 2011 11:34:45 +0800 Cong Wang wrote:

> Hi, Andrew,
> 
> Do you think my patch below is better?

Hi,

This causes build errors for me because node.o is not being built:

arch/x86/built-in.o: In function `topology_init':
topology.c:(.init.text+0x3668): undefined reference to `register_one_node'
drivers/built-in.o: In function `unregister_cpu':
(.text+0x7aecc): undefined reference to `unregister_cpu_under_node'
drivers/built-in.o: In function `register_cpu':
(.cpuinit.text+0xc1): undefined reference to `register_cpu_under_node'


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

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [Patch] numa: introduce CONFIG_NUMA_SYSFS for drivers/base/node.c
  2011-08-25  2:14         ` Randy Dunlap
@ 2011-08-25  3:31           ` Cong Wang
  -1 siblings, 0 replies; 41+ messages in thread
From: Cong Wang @ 2011-08-25  3:31 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: Andrew Morton, Stephen Rothwell, gregkh, linux-next, LKML, linux-mm

[-- Attachment #1: Type: text/plain, Size: 740 bytes --]

于 2011年08月25日 10:14, Randy Dunlap 写道:
> On Wed, 24 Aug 2011 11:34:45 +0800 Cong Wang wrote:
>
>> Hi, Andrew,
>>
>> Do you think my patch below is better?
>
> Hi,
>
> This causes build errors for me because node.o is not being built:
>
> arch/x86/built-in.o: In function `topology_init':
> topology.c:(.init.text+0x3668): undefined reference to `register_one_node'
> drivers/built-in.o: In function `unregister_cpu':
> (.text+0x7aecc): undefined reference to `unregister_cpu_under_node'
> drivers/built-in.o: In function `register_cpu':
> (.cpuinit.text+0xc1): undefined reference to `register_cpu_under_node'

Ah, this is because I missed the part in include/linux/node.h. :)

Below is the updated version.

Thanks for testing!

[-- Attachment #2: n.diff --]
[-- Type: text/plain, Size: 1586 bytes --]

diff --git a/drivers/base/Makefile b/drivers/base/Makefile
index 99a375a..e382338 100644
--- a/drivers/base/Makefile
+++ b/drivers/base/Makefile
@@ -10,7 +10,7 @@ obj-$(CONFIG_HAS_DMA)	+= dma-mapping.o
 obj-$(CONFIG_HAVE_GENERIC_DMA_COHERENT) += dma-coherent.o
 obj-$(CONFIG_ISA)	+= isa.o
 obj-$(CONFIG_FW_LOADER)	+= firmware_class.o
-obj-$(CONFIG_NUMA)	+= node.o
+obj-$(CONFIG_NUMA_SYSFS)	+= node.o
 obj-$(CONFIG_MEMORY_HOTPLUG_SPARSE) += memory.o
 obj-$(CONFIG_SMP)	+= topology.o
 ifeq ($(CONFIG_SYSFS),y)
diff --git a/include/linux/node.h b/include/linux/node.h
index 92370e2..a0cc5f9 100644
--- a/include/linux/node.h
+++ b/include/linux/node.h
@@ -32,7 +32,7 @@ typedef  void (*node_registration_func_t)(struct node *);
 
 extern int register_node(struct node *, int, struct node *);
 extern void unregister_node(struct node *node);
-#ifdef CONFIG_NUMA
+#ifdef defined(CONFIG_NUMA) && defined(CONFIG_SYSFS)
 extern int register_one_node(int nid);
 extern void unregister_one_node(int nid);
 extern int register_cpu_under_node(unsigned int cpu, unsigned int nid);
diff --git a/mm/Kconfig b/mm/Kconfig
index f2f1ca1..77345e7 100644
--- a/mm/Kconfig
+++ b/mm/Kconfig
@@ -340,6 +340,16 @@ choice
 	  benefit.
 endchoice
 
+config NUMA_SYSFS
+	bool "Enable NUMA sysfs interface for user-space"
+	depends on NUMA
+	depends on SYSFS
+	default y
+	help
+	  This enables NUMA sysfs interface, /sys/devices/system/node/*
+	  files, for user-space tools, like numactl. If you have enabled
+	  NUMA, probably you also need this one.
+
 #
 # UP and nommu archs use km based percpu allocator
 #

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

* Re: [Patch] numa: introduce CONFIG_NUMA_SYSFS for drivers/base/node.c
@ 2011-08-25  3:31           ` Cong Wang
  0 siblings, 0 replies; 41+ messages in thread
From: Cong Wang @ 2011-08-25  3:31 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: Andrew Morton, Stephen Rothwell, gregkh, linux-next, LKML, linux-mm

[-- Attachment #1: Type: text/plain, Size: 744 bytes --]

ao? 2011a1'08ae??25ae?JPY 10:14, Randy Dunlap a??e??:
> On Wed, 24 Aug 2011 11:34:45 +0800 Cong Wang wrote:
>
>> Hi, Andrew,
>>
>> Do you think my patch below is better?
>
> Hi,
>
> This causes build errors for me because node.o is not being built:
>
> arch/x86/built-in.o: In function `topology_init':
> topology.c:(.init.text+0x3668): undefined reference to `register_one_node'
> drivers/built-in.o: In function `unregister_cpu':
> (.text+0x7aecc): undefined reference to `unregister_cpu_under_node'
> drivers/built-in.o: In function `register_cpu':
> (.cpuinit.text+0xc1): undefined reference to `register_cpu_under_node'

Ah, this is because I missed the part in include/linux/node.h. :)

Below is the updated version.

Thanks for testing!

[-- Attachment #2: n.diff --]
[-- Type: text/plain, Size: 1586 bytes --]

diff --git a/drivers/base/Makefile b/drivers/base/Makefile
index 99a375a..e382338 100644
--- a/drivers/base/Makefile
+++ b/drivers/base/Makefile
@@ -10,7 +10,7 @@ obj-$(CONFIG_HAS_DMA)	+= dma-mapping.o
 obj-$(CONFIG_HAVE_GENERIC_DMA_COHERENT) += dma-coherent.o
 obj-$(CONFIG_ISA)	+= isa.o
 obj-$(CONFIG_FW_LOADER)	+= firmware_class.o
-obj-$(CONFIG_NUMA)	+= node.o
+obj-$(CONFIG_NUMA_SYSFS)	+= node.o
 obj-$(CONFIG_MEMORY_HOTPLUG_SPARSE) += memory.o
 obj-$(CONFIG_SMP)	+= topology.o
 ifeq ($(CONFIG_SYSFS),y)
diff --git a/include/linux/node.h b/include/linux/node.h
index 92370e2..a0cc5f9 100644
--- a/include/linux/node.h
+++ b/include/linux/node.h
@@ -32,7 +32,7 @@ typedef  void (*node_registration_func_t)(struct node *);
 
 extern int register_node(struct node *, int, struct node *);
 extern void unregister_node(struct node *node);
-#ifdef CONFIG_NUMA
+#ifdef defined(CONFIG_NUMA) && defined(CONFIG_SYSFS)
 extern int register_one_node(int nid);
 extern void unregister_one_node(int nid);
 extern int register_cpu_under_node(unsigned int cpu, unsigned int nid);
diff --git a/mm/Kconfig b/mm/Kconfig
index f2f1ca1..77345e7 100644
--- a/mm/Kconfig
+++ b/mm/Kconfig
@@ -340,6 +340,16 @@ choice
 	  benefit.
 endchoice
 
+config NUMA_SYSFS
+	bool "Enable NUMA sysfs interface for user-space"
+	depends on NUMA
+	depends on SYSFS
+	default y
+	help
+	  This enables NUMA sysfs interface, /sys/devices/system/node/*
+	  files, for user-space tools, like numactl. If you have enabled
+	  NUMA, probably you also need this one.
+
 #
 # UP and nommu archs use km based percpu allocator
 #

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

* Re: [Patch] numa: introduce CONFIG_NUMA_SYSFS for drivers/base/node.c
  2011-08-25  3:31           ` Cong Wang
@ 2011-08-25  3:50             ` Randy Dunlap
  -1 siblings, 0 replies; 41+ messages in thread
From: Randy Dunlap @ 2011-08-25  3:50 UTC (permalink / raw)
  To: Cong Wang
  Cc: Andrew Morton, Stephen Rothwell, gregkh, linux-next, LKML, linux-mm

On Thu, 25 Aug 2011 11:31:45 +0800 Cong Wang wrote:

> 于 2011年08月25日 10:14, Randy Dunlap 写道:
> > On Wed, 24 Aug 2011 11:34:45 +0800 Cong Wang wrote:
> >
> >> Hi, Andrew,
> >>
> >> Do you think my patch below is better?
> >
> > Hi,
> >
> > This causes build errors for me because node.o is not being built:
> >
> > arch/x86/built-in.o: In function `topology_init':
> > topology.c:(.init.text+0x3668): undefined reference to `register_one_node'
> > drivers/built-in.o: In function `unregister_cpu':
> > (.text+0x7aecc): undefined reference to `unregister_cpu_under_node'
> > drivers/built-in.o: In function `register_cpu':
> > (.cpuinit.text+0xc1): undefined reference to `register_cpu_under_node'
> 
> Ah, this is because I missed the part in include/linux/node.h. :)
> 
> Below is the updated version.
> 
> Thanks for testing!

Yes, that works after changing #ifdef defined(...)
to #if defined(...)

Acked-by: Randy Dunlap <rdunlap@xenotime.net>


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

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

* Re: [Patch] numa: introduce CONFIG_NUMA_SYSFS for drivers/base/node.c
@ 2011-08-25  3:50             ` Randy Dunlap
  0 siblings, 0 replies; 41+ messages in thread
From: Randy Dunlap @ 2011-08-25  3:50 UTC (permalink / raw)
  To: Cong Wang
  Cc: Andrew Morton, Stephen Rothwell, gregkh, linux-next, LKML, linux-mm

On Thu, 25 Aug 2011 11:31:45 +0800 Cong Wang wrote:

> ao? 2011a1'08ae??25ae?JPY 10:14, Randy Dunlap a??e??:
> > On Wed, 24 Aug 2011 11:34:45 +0800 Cong Wang wrote:
> >
> >> Hi, Andrew,
> >>
> >> Do you think my patch below is better?
> >
> > Hi,
> >
> > This causes build errors for me because node.o is not being built:
> >
> > arch/x86/built-in.o: In function `topology_init':
> > topology.c:(.init.text+0x3668): undefined reference to `register_one_node'
> > drivers/built-in.o: In function `unregister_cpu':
> > (.text+0x7aecc): undefined reference to `unregister_cpu_under_node'
> > drivers/built-in.o: In function `register_cpu':
> > (.cpuinit.text+0xc1): undefined reference to `register_cpu_under_node'
> 
> Ah, this is because I missed the part in include/linux/node.h. :)
> 
> Below is the updated version.
> 
> Thanks for testing!

Yes, that works after changing #ifdef defined(...)
to #if defined(...)

Acked-by: Randy Dunlap <rdunlap@xenotime.net>


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

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [Patch] numa: introduce CONFIG_NUMA_SYSFS for drivers/base/node.c
  2011-08-25  3:50             ` Randy Dunlap
@ 2011-08-25  5:04               ` David Rientjes
  -1 siblings, 0 replies; 41+ messages in thread
From: David Rientjes @ 2011-08-25  5:04 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: Cong Wang, Andrew Morton, Stephen Rothwell, gregkh, linux-next,
	LKML, linux-mm

On Wed, 24 Aug 2011, Randy Dunlap wrote:

> > Below is the updated version.
> > 
> > Thanks for testing!
> 
> Yes, that works after changing #ifdef defined(...)
> to #if defined(...)
> 
> Acked-by: Randy Dunlap <rdunlap@xenotime.net>
> 

No, it doesn't work, CONFIG_HUGETLBFS can be enabled with CONFIG_NUMA=y 
and CONFIG_SYSFS=n and that uses data structures from drivers/base/node.c 
which doesn't get compiled with this patch.

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

* Re: [Patch] numa: introduce CONFIG_NUMA_SYSFS for drivers/base/node.c
@ 2011-08-25  5:04               ` David Rientjes
  0 siblings, 0 replies; 41+ messages in thread
From: David Rientjes @ 2011-08-25  5:04 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: Cong Wang, Andrew Morton, Stephen Rothwell, gregkh, linux-next,
	LKML, linux-mm

On Wed, 24 Aug 2011, Randy Dunlap wrote:

> > Below is the updated version.
> > 
> > Thanks for testing!
> 
> Yes, that works after changing #ifdef defined(...)
> to #if defined(...)
> 
> Acked-by: Randy Dunlap <rdunlap@xenotime.net>
> 

No, it doesn't work, CONFIG_HUGETLBFS can be enabled with CONFIG_NUMA=y 
and CONFIG_SYSFS=n and that uses data structures from drivers/base/node.c 
which doesn't get compiled with this patch.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* [patch] numa: fix NUMA compile error when sysfs and procfs are disabled
  2011-08-25  3:31           ` Cong Wang
@ 2011-08-25  5:55             ` David Rientjes
  -1 siblings, 0 replies; 41+ messages in thread
From: David Rientjes @ 2011-08-25  5:55 UTC (permalink / raw)
  To: Andrew Morton, Cong Wang
  Cc: Randy Dunlap, Stephen Rothwell, Greg Kroah-Hartman, linux-next,
	LKML, linux-mm

On Thu, 25 Aug 2011, Cong Wang wrote:

> Ah, this is because I missed the part in include/linux/node.h. :)
> 
> Below is the updated version.
> 

I've never had a problem building a kernel with CONFIG_NUMA=y and 
CONFIG_SYSFS=n since most of drivers/base/node.c is just an abstraction 
that calls into sysfs functions that will be no-ops in such a 
configuration.

The error you cite in a different thread 
(http://marc.info/?l=linux-mm&m=131098795024186) about an undefined 
reference to vmstat_text is because you have CONFIG_NUMA enabled and both 
CONFIG_SYSFS and CONFIG_PROC_FS disabled and we only define vmstat_text 
for those fs configurations since that's the only way these strings were 
ever emitted before per-node vmstat.

The correct fix is to define the array for CONFIG_NUMA as well.



numa: fix NUMA compile error when sysfs and procfs are disabled

The vmstat_text array is only defined for CONFIG_SYSFS or CONFIG_PROC_FS, 
yet it is referenced for per-node vmstat with CONFIG_NUMA:

	drivers/built-in.o: In function `node_read_vmstat':
	node.c:(.text+0x1106df): undefined reference to `vmstat_text'

in fa25c503dfa2 (mm: per-node vmstat: show proper vmstats).

Define the array for CONFIG_NUMA as well.

Reported-by: Cong Wang <amwang@redhat.com>
Signed-off-by: David Rientjes <rientjes@google.com>
---
 include/linux/vmstat.h |    2 ++
 mm/vmstat.c            |    4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h
--- a/include/linux/vmstat.h
+++ b/include/linux/vmstat.h
@@ -258,6 +258,8 @@ static inline void refresh_zone_stat_thresholds(void) { }
 
 #endif		/* CONFIG_SMP */
 
+#if defined(CONFIG_PROC_FS) || defined(CONFIG_SYSFS) || defined(CONFIG_NUMA)
 extern const char * const vmstat_text[];
+#endif
 
 #endif /* _LINUX_VMSTAT_H */
diff --git a/mm/vmstat.c b/mm/vmstat.c
--- a/mm/vmstat.c
+++ b/mm/vmstat.c
@@ -659,7 +659,7 @@ static void walk_zones_in_node(struct seq_file *m, pg_data_t *pgdat,
 }
 #endif
 
-#if defined(CONFIG_PROC_FS) || defined(CONFIG_SYSFS)
+#if defined(CONFIG_PROC_FS) || defined(CONFIG_SYSFS) || defined(CONFIG_NUMA)
 #ifdef CONFIG_ZONE_DMA
 #define TEXT_FOR_DMA(xx) xx "_dma",
 #else
@@ -788,7 +788,7 @@ const char * const vmstat_text[] = {
 
 #endif /* CONFIG_VM_EVENTS_COUNTERS */
 };
-#endif /* CONFIG_PROC_FS || CONFIG_SYSFS */
+#endif /* CONFIG_PROC_FS || CONFIG_SYSFS || CONFIG_NUMA */
 
 
 #ifdef CONFIG_PROC_FS

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

* [patch] numa: fix NUMA compile error when sysfs and procfs are disabled
@ 2011-08-25  5:55             ` David Rientjes
  0 siblings, 0 replies; 41+ messages in thread
From: David Rientjes @ 2011-08-25  5:55 UTC (permalink / raw)
  To: Andrew Morton, Cong Wang
  Cc: Randy Dunlap, Stephen Rothwell, Greg Kroah-Hartman, linux-next,
	LKML, linux-mm

On Thu, 25 Aug 2011, Cong Wang wrote:

> Ah, this is because I missed the part in include/linux/node.h. :)
> 
> Below is the updated version.
> 

I've never had a problem building a kernel with CONFIG_NUMA=y and 
CONFIG_SYSFS=n since most of drivers/base/node.c is just an abstraction 
that calls into sysfs functions that will be no-ops in such a 
configuration.

The error you cite in a different thread 
(http://marc.info/?l=linux-mm&m=131098795024186) about an undefined 
reference to vmstat_text is because you have CONFIG_NUMA enabled and both 
CONFIG_SYSFS and CONFIG_PROC_FS disabled and we only define vmstat_text 
for those fs configurations since that's the only way these strings were 
ever emitted before per-node vmstat.

The correct fix is to define the array for CONFIG_NUMA as well.



numa: fix NUMA compile error when sysfs and procfs are disabled

The vmstat_text array is only defined for CONFIG_SYSFS or CONFIG_PROC_FS, 
yet it is referenced for per-node vmstat with CONFIG_NUMA:

	drivers/built-in.o: In function `node_read_vmstat':
	node.c:(.text+0x1106df): undefined reference to `vmstat_text'

in fa25c503dfa2 (mm: per-node vmstat: show proper vmstats).

Define the array for CONFIG_NUMA as well.

Reported-by: Cong Wang <amwang@redhat.com>
Signed-off-by: David Rientjes <rientjes@google.com>
---
 include/linux/vmstat.h |    2 ++
 mm/vmstat.c            |    4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h
--- a/include/linux/vmstat.h
+++ b/include/linux/vmstat.h
@@ -258,6 +258,8 @@ static inline void refresh_zone_stat_thresholds(void) { }
 
 #endif		/* CONFIG_SMP */
 
+#if defined(CONFIG_PROC_FS) || defined(CONFIG_SYSFS) || defined(CONFIG_NUMA)
 extern const char * const vmstat_text[];
+#endif
 
 #endif /* _LINUX_VMSTAT_H */
diff --git a/mm/vmstat.c b/mm/vmstat.c
--- a/mm/vmstat.c
+++ b/mm/vmstat.c
@@ -659,7 +659,7 @@ static void walk_zones_in_node(struct seq_file *m, pg_data_t *pgdat,
 }
 #endif
 
-#if defined(CONFIG_PROC_FS) || defined(CONFIG_SYSFS)
+#if defined(CONFIG_PROC_FS) || defined(CONFIG_SYSFS) || defined(CONFIG_NUMA)
 #ifdef CONFIG_ZONE_DMA
 #define TEXT_FOR_DMA(xx) xx "_dma",
 #else
@@ -788,7 +788,7 @@ const char * const vmstat_text[] = {
 
 #endif /* CONFIG_VM_EVENTS_COUNTERS */
 };
-#endif /* CONFIG_PROC_FS || CONFIG_SYSFS */
+#endif /* CONFIG_PROC_FS || CONFIG_SYSFS || CONFIG_NUMA */
 
 
 #ifdef CONFIG_PROC_FS

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [Patch] numa: introduce CONFIG_NUMA_SYSFS for drivers/base/node.c
  2011-08-25  5:04               ` David Rientjes
  (?)
@ 2011-08-25 10:22                 ` Cong Wang
  -1 siblings, 0 replies; 41+ messages in thread
From: Cong Wang @ 2011-08-25 10:22 UTC (permalink / raw)
  To: David Rientjes
  Cc: Randy Dunlap, Andrew Morton, Stephen Rothwell, gregkh,
	linux-next, LKML, linux-mm

于 2011年08月25日 13:04, David Rientjes 写道:
> On Wed, 24 Aug 2011, Randy Dunlap wrote:
>
>>> Below is the updated version.
>>>
>>> Thanks for testing!
>>
>> Yes, that works after changing #ifdef defined(...)
>> to #if defined(...)
>>
>> Acked-by: Randy Dunlap<rdunlap@xenotime.net>
>>
>
> No, it doesn't work, CONFIG_HUGETLBFS can be enabled with CONFIG_NUMA=y
> and CONFIG_SYSFS=n and that uses data structures from drivers/base/node.c
> which doesn't get compiled with this patch.

So, you mean with CONFIG_NUMA=y && CONFIG_SYSFS=n && CONFIG_HUGETLBFS=y
we still get compile error?

Which data structures are used by hugetlbfs?

Thanks.


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

* Re: [Patch] numa: introduce CONFIG_NUMA_SYSFS for drivers/base/node.c
@ 2011-08-25 10:22                 ` Cong Wang
  0 siblings, 0 replies; 41+ messages in thread
From: Cong Wang @ 2011-08-25 10:22 UTC (permalink / raw)
  To: David Rientjes
  Cc: Randy Dunlap, Andrew Morton, Stephen Rothwell, gregkh,
	linux-next, LKML, linux-mm

于 2011年08月25日 13:04, David Rientjes 写道:
> On Wed, 24 Aug 2011, Randy Dunlap wrote:
>
>>> Below is the updated version.
>>>
>>> Thanks for testing!
>>
>> Yes, that works after changing #ifdef defined(...)
>> to #if defined(...)
>>
>> Acked-by: Randy Dunlap<rdunlap@xenotime.net>
>>
>
> No, it doesn't work, CONFIG_HUGETLBFS can be enabled with CONFIG_NUMA=y
> and CONFIG_SYSFS=n and that uses data structures from drivers/base/node.c
> which doesn't get compiled with this patch.

So, you mean with CONFIG_NUMA=y && CONFIG_SYSFS=n && CONFIG_HUGETLBFS=y
we still get compile error?

Which data structures are used by hugetlbfs?

Thanks.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [Patch] numa: introduce CONFIG_NUMA_SYSFS for drivers/base/node.c
@ 2011-08-25 10:22                 ` Cong Wang
  0 siblings, 0 replies; 41+ messages in thread
From: Cong Wang @ 2011-08-25 10:22 UTC (permalink / raw)
  To: David Rientjes
  Cc: Randy Dunlap, Andrew Morton, Stephen Rothwell, gregkh,
	linux-next, LKML, linux-mm

ao? 2011a1'08ae??25ae?JPY 13:04, David Rientjes a??e??:
> On Wed, 24 Aug 2011, Randy Dunlap wrote:
>
>>> Below is the updated version.
>>>
>>> Thanks for testing!
>>
>> Yes, that works after changing #ifdef defined(...)
>> to #if defined(...)
>>
>> Acked-by: Randy Dunlap<rdunlap@xenotime.net>
>>
>
> No, it doesn't work, CONFIG_HUGETLBFS can be enabled with CONFIG_NUMA=y
> and CONFIG_SYSFS=n and that uses data structures from drivers/base/node.c
> which doesn't get compiled with this patch.

So, you mean with CONFIG_NUMA=y && CONFIG_SYSFS=n && CONFIG_HUGETLBFS=y
we still get compile error?

Which data structures are used by hugetlbfs?

Thanks.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [patch] numa: fix NUMA compile error when sysfs and procfs are disabled
  2011-08-25  5:55             ` David Rientjes
@ 2011-08-25 17:17               ` Randy Dunlap
  -1 siblings, 0 replies; 41+ messages in thread
From: Randy Dunlap @ 2011-08-25 17:17 UTC (permalink / raw)
  To: David Rientjes
  Cc: Andrew Morton, Cong Wang, Stephen Rothwell, Greg Kroah-Hartman,
	linux-next, LKML, linux-mm

On Wed, 24 Aug 2011 22:55:02 -0700 (PDT) David Rientjes wrote:

> On Thu, 25 Aug 2011, Cong Wang wrote:
> 
> > Ah, this is because I missed the part in include/linux/node.h. :)
> > 
> > Below is the updated version.
> > 
> 
> I've never had a problem building a kernel with CONFIG_NUMA=y and 
> CONFIG_SYSFS=n since most of drivers/base/node.c is just an abstraction 
> that calls into sysfs functions that will be no-ops in such a 
> configuration.
> 
> The error you cite in a different thread 
> (http://marc.info/?l=linux-mm&m=131098795024186) about an undefined 
> reference to vmstat_text is because you have CONFIG_NUMA enabled and both 
> CONFIG_SYSFS and CONFIG_PROC_FS disabled and we only define vmstat_text 
> for those fs configurations since that's the only way these strings were 
> ever emitted before per-node vmstat.
> 
> The correct fix is to define the array for CONFIG_NUMA as well.
> 
> 
> 
> numa: fix NUMA compile error when sysfs and procfs are disabled
> 
> The vmstat_text array is only defined for CONFIG_SYSFS or CONFIG_PROC_FS, 
> yet it is referenced for per-node vmstat with CONFIG_NUMA:
> 
> 	drivers/built-in.o: In function `node_read_vmstat':
> 	node.c:(.text+0x1106df): undefined reference to `vmstat_text'
> 
> in fa25c503dfa2 (mm: per-node vmstat: show proper vmstats).
> 
> Define the array for CONFIG_NUMA as well.
> 
> Reported-by: Cong Wang <amwang@redhat.com>
> Signed-off-by: David Rientjes <rientjes@google.com>

Sure, that also works.
Acked-by: Randy Dunlap <rdunlap@xenotime.net>


> ---
>  include/linux/vmstat.h |    2 ++
>  mm/vmstat.c            |    4 ++--
>  2 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h
> --- a/include/linux/vmstat.h
> +++ b/include/linux/vmstat.h
> @@ -258,6 +258,8 @@ static inline void refresh_zone_stat_thresholds(void) { }
>  
>  #endif		/* CONFIG_SMP */
>  
> +#if defined(CONFIG_PROC_FS) || defined(CONFIG_SYSFS) || defined(CONFIG_NUMA)
>  extern const char * const vmstat_text[];
> +#endif
>  
>  #endif /* _LINUX_VMSTAT_H */
> diff --git a/mm/vmstat.c b/mm/vmstat.c
> --- a/mm/vmstat.c
> +++ b/mm/vmstat.c
> @@ -659,7 +659,7 @@ static void walk_zones_in_node(struct seq_file *m, pg_data_t *pgdat,
>  }
>  #endif
>  
> -#if defined(CONFIG_PROC_FS) || defined(CONFIG_SYSFS)
> +#if defined(CONFIG_PROC_FS) || defined(CONFIG_SYSFS) || defined(CONFIG_NUMA)
>  #ifdef CONFIG_ZONE_DMA
>  #define TEXT_FOR_DMA(xx) xx "_dma",
>  #else
> @@ -788,7 +788,7 @@ const char * const vmstat_text[] = {
>  
>  #endif /* CONFIG_VM_EVENTS_COUNTERS */
>  };
> -#endif /* CONFIG_PROC_FS || CONFIG_SYSFS */
> +#endif /* CONFIG_PROC_FS || CONFIG_SYSFS || CONFIG_NUMA */
>  
>  
>  #ifdef CONFIG_PROC_FS


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

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

* Re: [patch] numa: fix NUMA compile error when sysfs and procfs are disabled
@ 2011-08-25 17:17               ` Randy Dunlap
  0 siblings, 0 replies; 41+ messages in thread
From: Randy Dunlap @ 2011-08-25 17:17 UTC (permalink / raw)
  To: David Rientjes
  Cc: Andrew Morton, Cong Wang, Stephen Rothwell, Greg Kroah-Hartman,
	linux-next, LKML, linux-mm

On Wed, 24 Aug 2011 22:55:02 -0700 (PDT) David Rientjes wrote:

> On Thu, 25 Aug 2011, Cong Wang wrote:
> 
> > Ah, this is because I missed the part in include/linux/node.h. :)
> > 
> > Below is the updated version.
> > 
> 
> I've never had a problem building a kernel with CONFIG_NUMA=y and 
> CONFIG_SYSFS=n since most of drivers/base/node.c is just an abstraction 
> that calls into sysfs functions that will be no-ops in such a 
> configuration.
> 
> The error you cite in a different thread 
> (http://marc.info/?l=linux-mm&m=131098795024186) about an undefined 
> reference to vmstat_text is because you have CONFIG_NUMA enabled and both 
> CONFIG_SYSFS and CONFIG_PROC_FS disabled and we only define vmstat_text 
> for those fs configurations since that's the only way these strings were 
> ever emitted before per-node vmstat.
> 
> The correct fix is to define the array for CONFIG_NUMA as well.
> 
> 
> 
> numa: fix NUMA compile error when sysfs and procfs are disabled
> 
> The vmstat_text array is only defined for CONFIG_SYSFS or CONFIG_PROC_FS, 
> yet it is referenced for per-node vmstat with CONFIG_NUMA:
> 
> 	drivers/built-in.o: In function `node_read_vmstat':
> 	node.c:(.text+0x1106df): undefined reference to `vmstat_text'
> 
> in fa25c503dfa2 (mm: per-node vmstat: show proper vmstats).
> 
> Define the array for CONFIG_NUMA as well.
> 
> Reported-by: Cong Wang <amwang@redhat.com>
> Signed-off-by: David Rientjes <rientjes@google.com>

Sure, that also works.
Acked-by: Randy Dunlap <rdunlap@xenotime.net>


> ---
>  include/linux/vmstat.h |    2 ++
>  mm/vmstat.c            |    4 ++--
>  2 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h
> --- a/include/linux/vmstat.h
> +++ b/include/linux/vmstat.h
> @@ -258,6 +258,8 @@ static inline void refresh_zone_stat_thresholds(void) { }
>  
>  #endif		/* CONFIG_SMP */
>  
> +#if defined(CONFIG_PROC_FS) || defined(CONFIG_SYSFS) || defined(CONFIG_NUMA)
>  extern const char * const vmstat_text[];
> +#endif
>  
>  #endif /* _LINUX_VMSTAT_H */
> diff --git a/mm/vmstat.c b/mm/vmstat.c
> --- a/mm/vmstat.c
> +++ b/mm/vmstat.c
> @@ -659,7 +659,7 @@ static void walk_zones_in_node(struct seq_file *m, pg_data_t *pgdat,
>  }
>  #endif
>  
> -#if defined(CONFIG_PROC_FS) || defined(CONFIG_SYSFS)
> +#if defined(CONFIG_PROC_FS) || defined(CONFIG_SYSFS) || defined(CONFIG_NUMA)
>  #ifdef CONFIG_ZONE_DMA
>  #define TEXT_FOR_DMA(xx) xx "_dma",
>  #else
> @@ -788,7 +788,7 @@ const char * const vmstat_text[] = {
>  
>  #endif /* CONFIG_VM_EVENTS_COUNTERS */
>  };
> -#endif /* CONFIG_PROC_FS || CONFIG_SYSFS */
> +#endif /* CONFIG_PROC_FS || CONFIG_SYSFS || CONFIG_NUMA */
>  
>  
>  #ifdef CONFIG_PROC_FS


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

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [Patch] numa: introduce CONFIG_NUMA_SYSFS for drivers/base/node.c
  2011-08-25 10:22                 ` Cong Wang
@ 2011-08-25 20:57                   ` David Rientjes
  -1 siblings, 0 replies; 41+ messages in thread
From: David Rientjes @ 2011-08-25 20:57 UTC (permalink / raw)
  To: Cong Wang
  Cc: Randy Dunlap, Andrew Morton, Stephen Rothwell, gregkh,
	linux-next, LKML, linux-mm

On Thu, 25 Aug 2011, Cong Wang wrote:

> > No, it doesn't work, CONFIG_HUGETLBFS can be enabled with CONFIG_NUMA=y
> > and CONFIG_SYSFS=n and that uses data structures from drivers/base/node.c
> > which doesn't get compiled with this patch.
> 
> So, you mean with CONFIG_NUMA=y && CONFIG_SYSFS=n && CONFIG_HUGETLBFS=y
> we still get compile error?
> 
> Which data structures are used by hugetlbfs?
> 

node_states[], which is revealed at link time if you tried to compile your 
patch.  It's obvious that we don't want to add per-node hugetlbfs 
attributes to sysfs directories if sysfs is disabled, so you need to 
modify the hugetlbfs code as well.

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

* Re: [Patch] numa: introduce CONFIG_NUMA_SYSFS for drivers/base/node.c
@ 2011-08-25 20:57                   ` David Rientjes
  0 siblings, 0 replies; 41+ messages in thread
From: David Rientjes @ 2011-08-25 20:57 UTC (permalink / raw)
  To: Cong Wang
  Cc: Randy Dunlap, Andrew Morton, Stephen Rothwell, gregkh,
	linux-next, LKML, linux-mm

On Thu, 25 Aug 2011, Cong Wang wrote:

> > No, it doesn't work, CONFIG_HUGETLBFS can be enabled with CONFIG_NUMA=y
> > and CONFIG_SYSFS=n and that uses data structures from drivers/base/node.c
> > which doesn't get compiled with this patch.
> 
> So, you mean with CONFIG_NUMA=y && CONFIG_SYSFS=n && CONFIG_HUGETLBFS=y
> we still get compile error?
> 
> Which data structures are used by hugetlbfs?
> 

node_states[], which is revealed at link time if you tried to compile your 
patch.  It's obvious that we don't want to add per-node hugetlbfs 
attributes to sysfs directories if sysfs is disabled, so you need to 
modify the hugetlbfs code as well.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [Patch] numa: introduce CONFIG_NUMA_SYSFS for drivers/base/node.c
  2011-08-25 20:57                   ` David Rientjes
  (?)
@ 2011-08-29  2:29                     ` Cong Wang
  -1 siblings, 0 replies; 41+ messages in thread
From: Cong Wang @ 2011-08-29  2:29 UTC (permalink / raw)
  To: David Rientjes
  Cc: Randy Dunlap, Andrew Morton, Stephen Rothwell, gregkh,
	linux-next, LKML, linux-mm

于 2011年08月26日 04:57, David Rientjes 写道:
> On Thu, 25 Aug 2011, Cong Wang wrote:
>
>>> No, it doesn't work, CONFIG_HUGETLBFS can be enabled with CONFIG_NUMA=y
>>> and CONFIG_SYSFS=n and that uses data structures from drivers/base/node.c
>>> which doesn't get compiled with this patch.
>>
>> So, you mean with CONFIG_NUMA=y&&  CONFIG_SYSFS=n&&  CONFIG_HUGETLBFS=y
>> we still get compile error?
>>
>> Which data structures are used by hugetlbfs?
>>
>
> node_states[], which is revealed at link time if you tried to compile your
> patch.  It's obvious that we don't want to add per-node hugetlbfs
> attributes to sysfs directories if sysfs is disabled, so you need to
> modify the hugetlbfs code as well.

Makes sense. Thanks!

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

* Re: [Patch] numa: introduce CONFIG_NUMA_SYSFS for drivers/base/node.c
@ 2011-08-29  2:29                     ` Cong Wang
  0 siblings, 0 replies; 41+ messages in thread
From: Cong Wang @ 2011-08-29  2:29 UTC (permalink / raw)
  To: David Rientjes
  Cc: Randy Dunlap, Andrew Morton, Stephen Rothwell, gregkh,
	linux-next, LKML, linux-mm

于 2011年08月26日 04:57, David Rientjes 写道:
> On Thu, 25 Aug 2011, Cong Wang wrote:
>
>>> No, it doesn't work, CONFIG_HUGETLBFS can be enabled with CONFIG_NUMA=y
>>> and CONFIG_SYSFS=n and that uses data structures from drivers/base/node.c
>>> which doesn't get compiled with this patch.
>>
>> So, you mean with CONFIG_NUMA=y&&  CONFIG_SYSFS=n&&  CONFIG_HUGETLBFS=y
>> we still get compile error?
>>
>> Which data structures are used by hugetlbfs?
>>
>
> node_states[], which is revealed at link time if you tried to compile your
> patch.  It's obvious that we don't want to add per-node hugetlbfs
> attributes to sysfs directories if sysfs is disabled, so you need to
> modify the hugetlbfs code as well.

Makes sense. Thanks!

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [Patch] numa: introduce CONFIG_NUMA_SYSFS for drivers/base/node.c
@ 2011-08-29  2:29                     ` Cong Wang
  0 siblings, 0 replies; 41+ messages in thread
From: Cong Wang @ 2011-08-29  2:29 UTC (permalink / raw)
  To: David Rientjes
  Cc: Randy Dunlap, Andrew Morton, Stephen Rothwell, gregkh,
	linux-next, LKML, linux-mm

ao? 2011a1'08ae??26ae?JPY 04:57, David Rientjes a??e??:
> On Thu, 25 Aug 2011, Cong Wang wrote:
>
>>> No, it doesn't work, CONFIG_HUGETLBFS can be enabled with CONFIG_NUMA=y
>>> and CONFIG_SYSFS=n and that uses data structures from drivers/base/node.c
>>> which doesn't get compiled with this patch.
>>
>> So, you mean with CONFIG_NUMA=y&&  CONFIG_SYSFS=n&&  CONFIG_HUGETLBFS=y
>> we still get compile error?
>>
>> Which data structures are used by hugetlbfs?
>>
>
> node_states[], which is revealed at link time if you tried to compile your
> patch.  It's obvious that we don't want to add per-node hugetlbfs
> attributes to sysfs directories if sysfs is disabled, so you need to
> modify the hugetlbfs code as well.

Makes sense. Thanks!

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

end of thread, other threads:[~2011-08-29  2:30 UTC | newest]

Thread overview: 41+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-04  4:58 linux-next: Tree for Aug 4 Stephen Rothwell
2011-08-04 21:24 ` linux-next: Tree for Aug 4 (zcache) Randy Dunlap
2011-08-04 21:44   ` Greg KH
2011-08-04 21:51     ` Randy Dunlap
2011-08-04 21:54       ` Thadeu Lima de Souza Cascardo
2011-08-04 21:54         ` Thadeu Lima de Souza Cascardo
2011-08-04 22:00       ` [PATCH] zcache: Use div_u64 for 64-bit division Thadeu Lima de Souza Cascardo
2011-08-04 22:17         ` Randy Dunlap
2011-08-04 22:22 ` [PATCH -next] drivers/base/inode.c: let vmstat_text be optional Randy Dunlap
2011-08-04 22:22   ` Randy Dunlap
2011-08-05  2:38   ` Cong Wang
2011-08-05  2:38     ` Cong Wang
2011-08-05  2:38     ` Cong Wang
2011-08-05  5:43     ` Randy Dunlap
2011-08-05  5:43       ` Randy Dunlap
2011-08-05  8:02       ` Cong Wang
2011-08-05  8:02         ` Cong Wang
2011-08-05  8:02         ` Cong Wang
2011-08-23 21:39   ` Andrew Morton
2011-08-23 21:39     ` Andrew Morton
2011-08-24  3:34     ` [Patch] numa: introduce CONFIG_NUMA_SYSFS for drivers/base/node.c Cong Wang
2011-08-25  2:14       ` Randy Dunlap
2011-08-25  2:14         ` Randy Dunlap
2011-08-25  3:31         ` Cong Wang
2011-08-25  3:31           ` Cong Wang
2011-08-25  3:50           ` Randy Dunlap
2011-08-25  3:50             ` Randy Dunlap
2011-08-25  5:04             ` David Rientjes
2011-08-25  5:04               ` David Rientjes
2011-08-25 10:22               ` Cong Wang
2011-08-25 10:22                 ` Cong Wang
2011-08-25 10:22                 ` Cong Wang
2011-08-25 20:57                 ` David Rientjes
2011-08-25 20:57                   ` David Rientjes
2011-08-29  2:29                   ` Cong Wang
2011-08-29  2:29                     ` Cong Wang
2011-08-29  2:29                     ` Cong Wang
2011-08-25  5:55           ` [patch] numa: fix NUMA compile error when sysfs and procfs are disabled David Rientjes
2011-08-25  5:55             ` David Rientjes
2011-08-25 17:17             ` Randy Dunlap
2011-08-25 17:17               ` Randy Dunlap

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.