All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] shmem.c: Compilation failure in shmem_file_setup for !CONFIG_MMU
@ 2012-02-20 11:11 ` Kautuk Consul
  0 siblings, 0 replies; 3+ messages in thread
From: Kautuk Consul @ 2012-02-20 11:11 UTC (permalink / raw)
  To: Hugh Dickins; +Cc: linux-mm, linux-kernel, Kautuk Consul

I disabled the CONFIG_MMU and tried to compile the kernel and got the
following problem:
In function ‘shmem_file_setup’:
error: implicit declaration of function ‘ramfs_nommu_expand_for_mapping’

This is because, we do not include ramfs.h for CONFIG_SHMEM.

Included linux/ramfs.h for both CONFIG_SHMEM as well as !CONFIG_SHMEM.

Signed-off-by: Kautuk Consul <consul.kautuk@gmail.com>
---
 mm/shmem.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/mm/shmem.c b/mm/shmem.c
index 269d049..4884188 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -30,6 +30,7 @@
 #include <linux/mm.h>
 #include <linux/export.h>
 #include <linux/swap.h>
+#include <linux/ramfs.h>
 
 static struct vfsmount *shm_mnt;
 
@@ -2442,8 +2443,6 @@ out4:
  * effectively equivalent, but much lighter weight.
  */
 
-#include <linux/ramfs.h>
-
 static struct file_system_type shmem_fs_type = {
 	.name		= "tmpfs",
 	.mount		= ramfs_mount,
-- 
1.7.5.4


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

* [PATCH 1/1] shmem.c: Compilation failure in shmem_file_setup for !CONFIG_MMU
@ 2012-02-20 11:11 ` Kautuk Consul
  0 siblings, 0 replies; 3+ messages in thread
From: Kautuk Consul @ 2012-02-20 11:11 UTC (permalink / raw)
  To: Hugh Dickins; +Cc: linux-mm, linux-kernel, Kautuk Consul

I disabled the CONFIG_MMU and tried to compile the kernel and got the
following problem:
In function a??shmem_file_setupa??:
error: implicit declaration of function a??ramfs_nommu_expand_for_mappinga??

This is because, we do not include ramfs.h for CONFIG_SHMEM.

Included linux/ramfs.h for both CONFIG_SHMEM as well as !CONFIG_SHMEM.

Signed-off-by: Kautuk Consul <consul.kautuk@gmail.com>
---
 mm/shmem.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/mm/shmem.c b/mm/shmem.c
index 269d049..4884188 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -30,6 +30,7 @@
 #include <linux/mm.h>
 #include <linux/export.h>
 #include <linux/swap.h>
+#include <linux/ramfs.h>
 
 static struct vfsmount *shm_mnt;
 
@@ -2442,8 +2443,6 @@ out4:
  * effectively equivalent, but much lighter weight.
  */
 
-#include <linux/ramfs.h>
-
 static struct file_system_type shmem_fs_type = {
 	.name		= "tmpfs",
 	.mount		= ramfs_mount,
-- 
1.7.5.4

--
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 related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] shmem.c: Compilation failure in shmem_file_setup for !CONFIG_MMU
  2012-02-20 11:11 ` Kautuk Consul
  (?)
@ 2012-02-20 19:29 ` Hugh Dickins
  -1 siblings, 0 replies; 3+ messages in thread
From: Hugh Dickins @ 2012-02-20 19:29 UTC (permalink / raw)
  To: Kautuk Consul
  Cc: Eric Anholt, Keith Packard, Chris Wilson, linux-mm, linux-kernel

[-- Attachment #1: Type: TEXT/PLAIN, Size: 2627 bytes --]

On Mon, 20 Feb 2012, Kautuk Consul wrote:
> I disabled the CONFIG_MMU and tried to compile the kernel and got the
> following problem:
> In function ‘shmem_file_setup’:
> error: implicit declaration of function ‘ramfs_nommu_expand_for_mapping’
> 
> This is because, we do not include ramfs.h for CONFIG_SHMEM.
> 
> Included linux/ramfs.h for both CONFIG_SHMEM as well as !CONFIG_SHMEM.
> 
> Signed-off-by: Kautuk Consul <consul.kautuk@gmail.com>

Thanks for looking into this, but I think that's the wrong fix.

We don't expect CONFIG_SHMEM=y without CONFIG_MMU=y, and init/Kconfig
does say config SHMEM depends on MMU.  I don't think anyone has ever
thought about the implications of CONFIG_SHMEM without CONFIG_MMU,
it just hasn't been needed.

If CONFIG_SHMEM is not set, then you should already have linux/ramfs.h
included.  So I expect it's one of those weakness-in-select issues:
something doing select SHMEM without a depends on MMU.

config DRM_I915?  i915 is happier to be served by SHMEM with its
use of swap, but by that logic i915 would want to select SWAP too.
It should be fine with ramfs: not as full an implementation, but
that's the tradeoff people choose when they ask for SHMEM off.
Is DRM_I915 any good without MMU??

When GEM went in, I remember we particularly asked for it not
to select SHMEM, but to work in the tiny !SHMEM ramfs case too.
Then I think some bug came up that made them add a select SHMEM
in a hurry.  Ah yes, bugzilla.kernel.org 14662.  Well, the
select TMPFS that was added afterwards was valid, but the
select SHMEM is not.

Things have changed again since then, since we switched i915 over
to shmem_read_mapping_page_gfp() and shmem_truncate_range(): I
believe nowadays it needs neither select SHMEM nor select TMPFS,
and I'd be very happy to see a tested patch from the i915 people
removing both those selects; but I'm unable to test it adequately
myself, so never pushed that change.

Hugh

> ---
>  mm/shmem.c |    3 +--
>  1 files changed, 1 insertions(+), 2 deletions(-)
> 
> diff --git a/mm/shmem.c b/mm/shmem.c
> index 269d049..4884188 100644
> --- a/mm/shmem.c
> +++ b/mm/shmem.c
> @@ -30,6 +30,7 @@
>  #include <linux/mm.h>
>  #include <linux/export.h>
>  #include <linux/swap.h>
> +#include <linux/ramfs.h>
>  
>  static struct vfsmount *shm_mnt;
>  
> @@ -2442,8 +2443,6 @@ out4:
>   * effectively equivalent, but much lighter weight.
>   */
>  
> -#include <linux/ramfs.h>
> -
>  static struct file_system_type shmem_fs_type = {
>  	.name		= "tmpfs",
>  	.mount		= ramfs_mount,
> -- 
> 1.7.5.4

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

end of thread, other threads:[~2012-02-20 19:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-20 11:11 [PATCH 1/1] shmem.c: Compilation failure in shmem_file_setup for !CONFIG_MMU Kautuk Consul
2012-02-20 11:11 ` Kautuk Consul
2012-02-20 19:29 ` Hugh Dickins

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.