All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3] meta/oe/lib/path.py - check mount points, not device
@ 2014-01-20 19:22 Jason Plum
  2014-01-24 14:05 ` Jason Plum
  2014-01-28 18:47 ` Saul Wold
  0 siblings, 2 replies; 6+ messages in thread
From: Jason Plum @ 2014-01-20 19:22 UTC (permalink / raw)
  To: openembedded-core

Signed-off-by: Jason Plum <jplum@devonit.com>
---
 meta/lib/oe/path.py | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/meta/lib/oe/path.py b/meta/lib/oe/path.py
index 46783f8..dab20fc 100644
--- a/meta/lib/oe/path.py
+++ b/meta/lib/oe/path.py
@@ -90,7 +90,7 @@ def copyhardlinktree(src, dst):
     if os.path.isdir(src) and not len(os.listdir(src)):
         return	
 
-    if (os.stat(src).st_dev ==  os.stat(dst).st_dev):
+    if (getmount(src) ==  getmount(dst)):
         # Need to copy directories only with tar first since cp will error if two 
         # writers try and create a directory at the same time
         cmd = 'cd %s; find . -type d -print | tar -cf - -C %s -p --files-from - --no-recursion | tar -xf - -C %s' % (src, src, dst)
@@ -257,3 +257,14 @@ def realpath(file, root, use_physdir = True, loop_cnt = 100, assume_dir = False)
         raise
 
     return file
+
+def getmount(path):
+    """ getmount takes a path parameter, uses os.path.realpath with os.path.abspath to
+    handle symlink resolution, and returns the path to the mount point of the input path
+    """
+    path = os.path.realpath(os.path.abspath(path))
+    while path != os.path.sep:
+        if os.path.ismount(path):
+            return path
+        path = os.path.abspath(os.path.join(path, os.pardir))
+    return path
\ No newline at end of file
-- 
1.8.5.3




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

* [PATCH v3] meta/oe/lib/path.py - check mount points, not device
  2014-01-20 19:22 [PATCH v3] meta/oe/lib/path.py - check mount points, not device Jason Plum
@ 2014-01-24 14:05 ` Jason Plum
  2014-01-28 18:47 ` Saul Wold
  1 sibling, 0 replies; 6+ messages in thread
From: Jason Plum @ 2014-01-24 14:05 UTC (permalink / raw)
  To: openembedded-core

Signed-off-by: Jason Plum <jplum@devonit.com>
---
  meta/lib/oe/path.py | 13 ++++++++++++-
  1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/meta/lib/oe/path.py b/meta/lib/oe/path.py
index 46783f8..dab20fc 100644
--- a/meta/lib/oe/path.py
+++ b/meta/lib/oe/path.py
@@ -90,7 +90,7 @@ def copyhardlinktree(src, dst):
      if os.path.isdir(src) and not len(os.listdir(src)):
          return	
  
-    if (os.stat(src).st_dev ==  os.stat(dst).st_dev):
+    if (getmount(src) ==  getmount(dst)):
          # Need to copy directories only with tar first since cp will error if two
          # writers try and create a directory at the same time
          cmd = 'cd %s; find . -type d -print | tar -cf - -C %s -p --files-from - --no-recursion | tar -xf - -C %s' % (src, src, dst)
@@ -257,3 +257,14 @@ def realpath(file, root, use_physdir = True, loop_cnt = 100, assume_dir = False)
          raise
  
      return file
+
+def getmount(path):
+    """ getmount takes a path parameter, uses os.path.realpath with os.path.abspath to
+    handle symlink resolution, and returns the path to the mount point of the input path
+    """
+    path = os.path.realpath(os.path.abspath(path))
+    while path != os.path.sep:
+        if os.path.ismount(path):
+            return path
+        path = os.path.abspath(os.path.join(path, os.pardir))
+    return path
\ No newline at end of file
-- 
1.8.5.3






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

* Re: [PATCH v3] meta/oe/lib/path.py - check mount points, not device
  2014-01-20 19:22 [PATCH v3] meta/oe/lib/path.py - check mount points, not device Jason Plum
  2014-01-24 14:05 ` Jason Plum
@ 2014-01-28 18:47 ` Saul Wold
  2014-01-29 14:54   ` Jason Plum
  1 sibling, 1 reply; 6+ messages in thread
From: Saul Wold @ 2014-01-28 18:47 UTC (permalink / raw)
  To: Jason Plum, openembedded-core

On 01/20/2014 11:22 AM, Jason Plum wrote:
> Signed-off-by: Jason Plum <jplum@devonit.com>
> ---
>   meta/lib/oe/path.py | 13 ++++++++++++-
>   1 file changed, 12 insertions(+), 1 deletion(-)
>

This patch is still not applying cleanly to master, I am also still a 
little concerned if this will affect performance since it's used often 
in sstate code.

Have you compared build times with and without this patch?

Sau!

> diff --git a/meta/lib/oe/path.py b/meta/lib/oe/path.py
> index 46783f8..dab20fc 100644
> --- a/meta/lib/oe/path.py
> +++ b/meta/lib/oe/path.py
> @@ -90,7 +90,7 @@ def copyhardlinktree(src, dst):
>       if os.path.isdir(src) and not len(os.listdir(src)):
>           return	
>
> -    if (os.stat(src).st_dev ==  os.stat(dst).st_dev):
> +    if (getmount(src) ==  getmount(dst)):
>           # Need to copy directories only with tar first since cp will error if two
>           # writers try and create a directory at the same time
>           cmd = 'cd %s; find . -type d -print | tar -cf - -C %s -p --files-from - --no-recursion | tar -xf - -C %s' % (src, src, dst)
> @@ -257,3 +257,14 @@ def realpath(file, root, use_physdir = True, loop_cnt = 100, assume_dir = False)
>           raise
>
>       return file
> +
> +def getmount(path):
> +    """ getmount takes a path parameter, uses os.path.realpath with os.path.abspath to
> +    handle symlink resolution, and returns the path to the mount point of the input path
> +    """
> +    path = os.path.realpath(os.path.abspath(path))
> +    while path != os.path.sep:
> +        if os.path.ismount(path):
> +            return path
> +        path = os.path.abspath(os.path.join(path, os.pardir))
> +    return path
> \ No newline at end of file
>


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

* Re: [PATCH v3] meta/oe/lib/path.py - check mount points, not device
  2014-01-28 18:47 ` Saul Wold
@ 2014-01-29 14:54   ` Jason Plum
  2014-02-10  6:59     ` Saul Wold
  0 siblings, 1 reply; 6+ messages in thread
From: Jason Plum @ 2014-01-29 14:54 UTC (permalink / raw)
  To: Saul Wold, openembedded-core


On 01/28/14 13:47, Saul Wold wrote:
> On 01/20/2014 11:22 AM, Jason Plum wrote:
>> Signed-off-by: Jason Plum <jplum@devonit.com>
>> ---
>>    meta/lib/oe/path.py | 13 ++++++++++++-
>>    1 file changed, 12 insertions(+), 1 deletion(-)
>>
> This patch is still not applying cleanly to master, I am also still a
> little concerned if this will affect performance since it's used often
> in sstate code.
>
> Have you compared build times with and without this patch?
>
> Sau!
Saul,

I pulled a fresh copy of master when I made this particular send-email 
patch, so it must keep changing from under me. I have the last commit to 
master on this checkout as 9c8d9781794ed0886a79c8ce4544ba98be0ff858

The performance difference should be quite minimal, but I have not 
extensively tested with timing metrics in place.
>> diff --git a/meta/lib/oe/path.py b/meta/lib/oe/path.py
>> index 46783f8..dab20fc 100644
>> --- a/meta/lib/oe/path.py
>> +++ b/meta/lib/oe/path.py
>> @@ -90,7 +90,7 @@ def copyhardlinktree(src, dst):
>>        if os.path.isdir(src) and not len(os.listdir(src)):
>>            return	
>>
>> -    if (os.stat(src).st_dev ==  os.stat(dst).st_dev):
>> +    if (getmount(src) ==  getmount(dst)):
>>            # Need to copy directories only with tar first since cp will error if two
>>            # writers try and create a directory at the same time
>>            cmd = 'cd %s; find . -type d -print | tar -cf - -C %s -p --files-from - --no-recursion | tar -xf - -C %s' % (src, src, dst)
>> @@ -257,3 +257,14 @@ def realpath(file, root, use_physdir = True, loop_cnt = 100, assume_dir = False)
>>            raise
>>
>>        return file
>> +
>> +def getmount(path):
>> +    """ getmount takes a path parameter, uses os.path.realpath with os.path.abspath to
>> +    handle symlink resolution, and returns the path to the mount point of the input path
>> +    """
>> +    path = os.path.realpath(os.path.abspath(path))
>> +    while path != os.path.sep:
>> +        if os.path.ismount(path):
>> +            return path
>> +        path = os.path.abspath(os.path.join(path, os.pardir))
>> +    return path
>> \ No newline at end of file
>>

-- 
Jason Plum
Sr. Software Engineer
Devon IT




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

* Re: [PATCH v3] meta/oe/lib/path.py - check mount points, not device
  2014-01-29 14:54   ` Jason Plum
@ 2014-02-10  6:59     ` Saul Wold
  2014-02-21  4:01       ` Saul Wold
  0 siblings, 1 reply; 6+ messages in thread
From: Saul Wold @ 2014-02-10  6:59 UTC (permalink / raw)
  To: Jason Plum, openembedded-core

On 01/29/2014 06:54 AM, Jason Plum wrote:
>
> On 01/28/14 13:47, Saul Wold wrote:
>> On 01/20/2014 11:22 AM, Jason Plum wrote:
>>> Signed-off-by: Jason Plum <jplum@devonit.com>
>>> ---
>>>    meta/lib/oe/path.py | 13 ++++++++++++-
>>>    1 file changed, 12 insertions(+), 1 deletion(-)
>>>
>> This patch is still not applying cleanly to master, I am also still a
>> little concerned if this will affect performance since it's used often
>> in sstate code.
>>
>> Have you compared build times with and without this patch?
>>
>> Sau!
> Saul,
>
> I pulled a fresh copy of master when I made this particular send-email
> patch, so it must keep changing from under me. I have the last commit to
> master on this checkout as 9c8d9781794ed0886a79c8ce4544ba98be0ff858
>
> The performance difference should be quite minimal, but I have not
> extensively tested with timing metrics in place.

Can you describe how much "quite minimal" really is, Richard is still 
concerned with the impact this might has (see his comment to my 
Consolidated Pull request).

Sau!

>>> diff --git a/meta/lib/oe/path.py b/meta/lib/oe/path.py
>>> index 46783f8..dab20fc 100644
>>> --- a/meta/lib/oe/path.py
>>> +++ b/meta/lib/oe/path.py
>>> @@ -90,7 +90,7 @@ def copyhardlinktree(src, dst):
>>>        if os.path.isdir(src) and not len(os.listdir(src)):
>>>            return
>>>
>>> -    if (os.stat(src).st_dev ==  os.stat(dst).st_dev):
>>> +    if (getmount(src) ==  getmount(dst)):
>>>            # Need to copy directories only with tar first since cp
>>> will error if two
>>>            # writers try and create a directory at the same time
>>>            cmd = 'cd %s; find . -type d -print | tar -cf - -C %s -p
>>> --files-from - --no-recursion | tar -xf - -C %s' % (src, src, dst)
>>> @@ -257,3 +257,14 @@ def realpath(file, root, use_physdir = True,
>>> loop_cnt = 100, assume_dir = False)
>>>            raise
>>>
>>>        return file
>>> +
>>> +def getmount(path):
>>> +    """ getmount takes a path parameter, uses os.path.realpath with
>>> os.path.abspath to
>>> +    handle symlink resolution, and returns the path to the mount
>>> point of the input path
>>> +    """
>>> +    path = os.path.realpath(os.path.abspath(path))
>>> +    while path != os.path.sep:
>>> +        if os.path.ismount(path):
>>> +            return path
>>> +        path = os.path.abspath(os.path.join(path, os.pardir))
>>> +    return path
>>> \ No newline at end of file
>>>
>


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

* Re: [PATCH v3] meta/oe/lib/path.py - check mount points, not device
  2014-02-10  6:59     ` Saul Wold
@ 2014-02-21  4:01       ` Saul Wold
  0 siblings, 0 replies; 6+ messages in thread
From: Saul Wold @ 2014-02-21  4:01 UTC (permalink / raw)
  To: Jason Plum, openembedded-core

On 02/09/2014 10:59 PM, Saul Wold wrote:
> On 01/29/2014 06:54 AM, Jason Plum wrote:
>>
>> On 01/28/14 13:47, Saul Wold wrote:
>>> On 01/20/2014 11:22 AM, Jason Plum wrote:
>>>> Signed-off-by: Jason Plum <jplum@devonit.com>
>>>> ---
>>>>    meta/lib/oe/path.py | 13 ++++++++++++-
>>>>    1 file changed, 12 insertions(+), 1 deletion(-)
>>>>
>>> This patch is still not applying cleanly to master, I am also still a
>>> little concerned if this will affect performance since it's used often
>>> in sstate code.
>>>
>>> Have you compared build times with and without this patch?
>>>
>>> Sau!
>> Saul,
>>
>> I pulled a fresh copy of master when I made this particular send-email
>> patch, so it must keep changing from under me. I have the last commit to
>> master on this checkout as 9c8d9781794ed0886a79c8ce4544ba98be0ff858
>>
>> The performance difference should be quite minimal, but I have not
>> extensively tested with timing metrics in place.
>
> Can you describe how much "quite minimal" really is, Richard is still
> concerned with the impact this might has (see his comment to my
> Consolidated Pull request).
>

Jason,

As mentioned before, there is some concern about this patch, if you 
could run before and after performance tests with the profile (-P) 
option and review the results, that would help us feel better about this 
patch.  Also an expanded commit messages explaining more about why this 
patch is needed would help.

Thanks

Sau!


> Sau!
>
>>>> diff --git a/meta/lib/oe/path.py b/meta/lib/oe/path.py
>>>> index 46783f8..dab20fc 100644
>>>> --- a/meta/lib/oe/path.py
>>>> +++ b/meta/lib/oe/path.py
>>>> @@ -90,7 +90,7 @@ def copyhardlinktree(src, dst):
>>>>        if os.path.isdir(src) and not len(os.listdir(src)):
>>>>            return
>>>>
>>>> -    if (os.stat(src).st_dev ==  os.stat(dst).st_dev):
>>>> +    if (getmount(src) ==  getmount(dst)):
>>>>            # Need to copy directories only with tar first since cp
>>>> will error if two
>>>>            # writers try and create a directory at the same time
>>>>            cmd = 'cd %s; find . -type d -print | tar -cf - -C %s -p
>>>> --files-from - --no-recursion | tar -xf - -C %s' % (src, src, dst)
>>>> @@ -257,3 +257,14 @@ def realpath(file, root, use_physdir = True,
>>>> loop_cnt = 100, assume_dir = False)
>>>>            raise
>>>>
>>>>        return file
>>>> +
>>>> +def getmount(path):
>>>> +    """ getmount takes a path parameter, uses os.path.realpath with
>>>> os.path.abspath to
>>>> +    handle symlink resolution, and returns the path to the mount
>>>> point of the input path
>>>> +    """
>>>> +    path = os.path.realpath(os.path.abspath(path))
>>>> +    while path != os.path.sep:
>>>> +        if os.path.ismount(path):
>>>> +            return path
>>>> +        path = os.path.abspath(os.path.join(path, os.pardir))
>>>> +    return path
>>>> \ No newline at end of file
>>>>
>>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>
>


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

end of thread, other threads:[~2014-02-21  4:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-20 19:22 [PATCH v3] meta/oe/lib/path.py - check mount points, not device Jason Plum
2014-01-24 14:05 ` Jason Plum
2014-01-28 18:47 ` Saul Wold
2014-01-29 14:54   ` Jason Plum
2014-02-10  6:59     ` Saul Wold
2014-02-21  4:01       ` Saul Wold

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.