All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Vladimir 'φ-coder/phcoder' Serbinenko" <phcoder@gmail.com>
To: grub-devel@gnu.org
Subject: Re: ReiserFS reading performance patch
Date: Sat, 28 Apr 2012 13:08:21 +0200	[thread overview]
Message-ID: <4F9BCFA5.4060108@gmail.com> (raw)
In-Reply-To: <CAF-6-Q2f-QC8kVco=e-X-ABKJYnyB4TrgXK2DEgBSF63z2CbaA@mail.gmail.com>

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

On 28.04.2012 12:06, Bean wrote:
> 2012/4/28 Vladimir 'φ-coder/phcoder' Serbinenko <phcoder@gmail.com>:
>> On 27.04.2012 20:36, Vladimir 'φ-coder/phcoder' Serbinenko wrote:
>>> On 27.04.2012 16:05, Albert Zeyer wrote:
>>>> * Write a simplified compile.py script.
>>> We don't have any compile.py.
>>>> * Remove nested functions. They don't work on Mac because of stack
>>>> execution protection.
>>> It can be disabled. It's Apple fault for not allowing to disable it
>>> selectively. Replacing nested functions is possible if done properly but
>>> the "let's make it all static" is wrong and will create problems with
>>> recursion, i.a. with nested partitions.
>> And actually nested functions don't matter. What does are trampolines
>> and they are only emitted it nested functions access local variables of
>> parent and not inlined.
> Hi,
>
> I think mac is not alone, netbsd uses non-executable stack and heap as
> well. Anyway, lower system security just to run an application does
> seem a little undesirable.
NetBSD allows to enable and disable heap execution at runtime using
__enable_executable_stack which is called by GCC automatically when
emitting trampolines.
> I once wrote a small framework to get rid of the nasty trampolines, for example:
>
> #define DEFINE_CLOSURE struct __closure_struct {
> #define DEFINE_CLOSURE_END } __closure_data;
> #define CLOSURE_TYPE void *__closure
void has a disadvantage of not checking the alignment. It's better to
use opaque structs.
> #define CLOSURE __closure
> #define CLOSURE_DATA &__closure_data
> #define USE_CLOSURE struct __closure_struct *__closure_p = __closure;
> #define UNUSED_CLOSURE (void) __closure;
We systematically use __attribute__ ((unused))
This is a good way of doing things when there is no other option.
However, in many cases it's better to use macros like FOR_*. They also
result in smaller code. The major point where it can't be done is with
->dir but this interface should be changed anyway because it forces some
code to scan through directory just to e.g. find out mtime of a single
file.



-- 
Regards
Vladimir 'φ-coder/phcoder' Serbinenko



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 294 bytes --]

  reply	other threads:[~2012-04-28 11:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-27 14:05 ReiserFS reading performance patch Albert Zeyer
2012-04-27 18:36 ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-04-27 20:31   ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-04-28 10:06     ` Bean
2012-04-28 11:08       ` Vladimir 'φ-coder/phcoder' Serbinenko [this message]
2012-05-01 17:59 ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-05-01 18:16   ` Vladimir 'φ-coder/phcoder' Serbinenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F9BCFA5.4060108@gmail.com \
    --to=phcoder@gmail.com \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.