1. 2

    Hi, I’m Neeraj and I mostly write about system security including topics like OpenBSD Internals, Kernel, Linux and other security or system related things that excites me :)

    Link: https://medium.com/@_neerajpal

    1. 4

      membar_producer() → Force visibility of all of the above changes.

      I believe this has to do with caching and ensures the new values will be up-to-date even when read from main memory by some consumer of this data, e.g. by the scheduler which could be running on another CPU. (I haven’t checked the code though so this is just a guess and might not reflect the actual semantics 100%.)

      Nice article!

      1. 2

        Yeah, I don’t know much about membar barrier operations but like I have read some blogs and some pieces of information that I found on google that it is something which is related to ordering-reordering of LOAD-STORE operations between on multiprocessor systems (in SMP). “The techniques for making memory visible from a processor core are known as memory barriers or fences. They make program state visible to other CPUs so they can act upon it.” – (From some blog that I have read)

        Thank you for your update on memory barrier I will update the same on the blog.

        Thanks for your feedback on the article. This keeps me motivated for going further to learn more and share my learnings.

      1. 6

        If anybody started reading this and was very, very confused, in the following word, the word “word” is really “passage”, and “passage” means “improved word”. Unlike, of course, just “word” as you know it to mean, in which case I’m referring to a word in a “passage”.

        “First of all, let me clear one important thing that pledge(1) and pledge(2) both are different things according to the man page of OpenBSD. Because parenthesis numbers indicate sections of a man page, like, (2) for system calls etc. So, here, parenthesis numbers are only to differentiate between the old pledge and new pledge or improved pledge, that’s all, nothing related to the parenthesis numbers of man page of OpenBSD.”

        I think there should be a filter for medium posts. Sigh.

        1. 1

          I don’t think that there are lots of confusions now. I know that first pledge(1) and pledge(2) were creating confusions, but then after that, I have changed the title and also written that paragraph for clarification. I too was thinking regarding this confusion, that how should I differentiate between the old pledge and improved pledge, so, I thought it would be great if I will try to explain what is what.

          But, if it is still confusing, then I apologize for my mistake. From on next time, I will keep these things in mind.

          1. 2

            It’s not your explanation that’s confusing—that’s just me being acerbic—it’s the notation itself. Consider using “pledge v.1” or “pledge v.2”, or better yet, “pledge 6.0” or “pledge 6.3” to refer to the OpenBSD version containing the described version. Then you can drop the explanations altogether and focus on the matter at hand.

            (And don’t forget pledge 5.8: tame!)

            1. 1

              Oh yeah, you are right. I can also use “pledge v.1 or pledge v.2 “ or “pledge 6.2”, that’s nice. even I had asked for suggestions for this on Google+, but, no one gave.

              Thank you very much for the clarification. I will update them. :)

        1. 1

          Hey, he stole my puffer! :D

          1. 2

            Yeah, Sorry for that, I should ask you first. I found it on google images. :)

            1. 1

              Np! Was neat seeing it on a site other than mine. Welcome!

              1. 1

                Was neat seeing it on a site other than mine. Welcome! Thanks for the high-quality version image. I have updated the image. :)