background preloader

Performances & Low level

Facebook Twitter

Comment rater ses benchmarks ? How Does an Intel Processor Boot? | Binary Debt. When we switch on a computer, it goes through a series of steps before it is able to load the operating system. In this post we will see how a typical x86 processor boots. This is a very complex and involved process.

We will only present a basic overall structure. Also what path is actually taken by the processor to reach a state where it can load an OS, is dependent on boot firmware. We will follow example of coreboot, an open source boot firmware. Before Power is Applied Let us start with BIOS chip, also known as boot ROM. When power is applied Modern Intel chips come with what is called Intel Management Engine. EDIT: (thanks to burfog for indicating that this needs explaination) You might be wondering how could a 16-bit system address 0xffff.fff0 which is clearly beyond 0xffff, the max 16-bit value?

CS << 4 + IP = 0x000f.0000 + 0xfff0 = 0x000f.fff0 which is still not what we expected. One of the first things that the boot firmware does is switch to 32-bit mode. Early Initialisations. Conflict-free replicated data type. The CRDT concept was formally defined in 2011 by Marc Shapiro, Nuno Preguiça, Carlos Baquero and Marek Zawirski. Development was initially motivated by collaborative text editing and mobile computing. CRDTs have also been used in online chat systems, online gambling, and in the SoundCloud audio distribution platform.

The NoSQL distributed databases Redis and Riak have CRDT data types.[1][2][3][4][5][6][7][8] Background[edit] Accordingly, much of distributed computing focuses on the problem of how to prevent concurrent updates to replicated data. But another possible approach is optimistic replication, where all concurrent updates are allowed to go through, with inconsistencies possibly created, and the results are merged or "resolved" later. As an example, a one-way Boolean event flag is a trivial CRDT: one bit, with a value of true or false. Types of CRDTs[edit] Operation-based CRDTs[edit] Operation-based CRDTs are referred to as commutative replicated data types, or CmRDTs. P[i] - Y.P[i] e. What's a CPU to do when it has nothing to do? October 5, 2018 This article was contributed by Tom Yates Kernel Recipes It would be reasonable to expect doing nothing to be an easy, simple task for a kernel, but it isn't.

At Kernel Recipes 2018, Rafael Wysocki discussed what CPUs do when they don't have anything to do, how the kernel handles this, problems inherent in the current strategy, and how his recent rework of the kernel's idle loop has improved power consumption on systems that aren't doing anything. The idle loop, one of the kernel subsystems that Wysocki maintains, controls what a CPU does when it has no processes to run. Precise to a fault, Wysocki defined his terms: for the purposes of this discussion, a CPU is an entity that can take instructions from memory and execute them at the same time as any other entities in the same system are doing likewise.

On a simple, single-core single-processor system, that core is the CPU. A CPU is idle if there are no tasks for it to run. Idle states are not free to enter or exit. A Brief History of High Availability. I once went to a website that had “hours of operation,” and was only “open” when its brick and mortar counterpart had its lights on.

I felt perplexed and a little frustrated; computers are capable of running all day every day, so why shouldn’t they? I’d been habituated to the internet’s incredible availability guarantees. However, before the internet, 24⁄7 availability wasn’t “a thing.” Availability was desirable, but not something to which we felt fundamentally entitled. We used computers only when we needed them; they weren’t waiting idly by on the off-chance a request came by. As the internet grew, those previously uncommon requests at 3am local time became prime business hours partway across the globe, and making sure that a computer could facilitate the request was important.

Many systems, though, relied on only one computer to facilitate these requests––which we all know is a story that doesn’t end well. Working with What We Have: Active-Passive Sharding Active-Active. Twitter. 24-core CPU and I can’t type an email (part one) I wasn’t looking for trouble. I wasn’t trying to build Chrome a thousand times in a weekend, I was just engaging in that most mundane of 21st century tasks, writing an email at 10:30 am.

And suddenly gmail hung. I kept typing but for several seconds but no characters were appearing on screen. Then, suddenly gmail caught up and I resumed my very important email. Then it happened again, only this time gmail went unresponsive for even longer. I have trouble resisting a good performance mystery but in this case the draw was particularly strong. This investigation had so many rabbit holes that I’m going to save some of the digressions for a follow-on post, but this one will entirely explain the hangs. As usual I had UIforETW running in the background, tracing to circular buffers, so I just had to type Ctrl+Win+R and the buffers, representing the last thirty seconds or so of system activity, were saved to disk. Okay, but why is Chrome stopping? The problem suddenly became clearer.

That’s it. Protecting Our Customers through the Lifecycle of Security Threats. By Leslie Culbertson Intel’s Product Assurance and Security (IPAS) team is focused on the cybersecurity landscape and constantly working to protect our customers. Recent initiatives include the expansion of our Bug Bounty program and increased partnerships with the research community, together with ongoing internal security testing and review of our products. We are diligent in these efforts because we recognize bad actors continuously pursue increasingly sophisticated attacks, and it will take all of us working together to deliver solutions. Today, Intel and our industry partners are sharing more details and mitigation information about a recently identified speculative execution side-channel method called L1 Terminal Fault (L1TF). More: Security Exploits and Intel Products (Press Kit) | Security Research Findings (Intel.com) L1TF is also addressed by changes we are already making at the hardware level.

About L1 Terminal Fault. Limiting Factors in a Dot Product Calculation | Richard Startin's Blog. The dot product is ubiquitous in computing. The calculation is used heavily in nearual networks for perceptron activation and for gradient descent algorithms for error backpropagation. It is one of the building blocks of linear regression. Cosine similarity in document search is yet another dot product. These use cases are more often implemented in C/C++ than in JVM languages, for reasons of efficiency, but what are the constraints on its computational performance? The combination of the computational simplicity and its streaming nature means the limiting factor in efficient code should be memory bandwidth. This is a good opportunity to look at the raw performance that will be made available with the vector API when it’s released. Written in Java code since Java 9, the code to calculate a dot product is easy, using the Math.fma intrinsic. public float vanilla() { float sum = 0f; for (int i = 0; i < size; ++i) { sum = Math.fma(left[i], right[i], sum); } return sum; } The Vector API.

C++ - Replacing a 32-bit loop count variable with 64-bit introduces crazy performance deviations. Why Skylake CPUs Are Sometimes 50% Slower – How Intel Has Broken Existing Code – Alois Kraus. I got a call that on newer hardware some performance regression tests have become slower. Not a big deal. Usually it is a bad configuration somewhere in Windows or some BIOS settings were set to non optimal values. But this time we were not able to find a setting that did bring performance back to normal. Since the change was not small 9s vs 19s (blue is old hardware orange is new hardware) we needed to drill deeper: Same OS, Same Hardware, Different CPU – 2 Times Slower A perf drop from 9,1s to 19,6s is definitely significant. And here is the one used for comparison The Xeon Gold runs on a different CPU Architecture named Skylake which is common to all CPUs produced by Intel since mid 2017. Remember the diff view in WPA shows in the table the delta of Trace 2 (11s) – Trace 1 (19s). To find where exactly the CPU was stuck would be interesting.

U xxx.dll+ImageRVA then I should see the instruction which was burning most CPU cycles which was basically only one hot address. E.g. How Bad Is It? How I use Wireshark. Hello! I was using Wireshark to debug a networking problem today, and I realized I’ve never written a blog post about Wireshark! Wireshark is one of my very favourite networking tools, so let’s fix that :) Wireshark is a really powerful and complicated tool, but in practice I only know how to do a very small number of things with it, and those things are really useful! So in this blog post, I’ll explain the 5 main things I use Wireshark for, and hopefully you’ll have a slightly clearer idea of why it’s useful. what’s Wireshark? Wireshark is a graphical network packet analysis tool.

On Mac, you can download & install it from their homepage, and on Debian, you can install it like this: sudo add-apt-repository ppa:wireshark-dev/stable sudo apt update sudo apt install wireshark Wireshark looks like this, and it can be a little overwhelming at first. Use Wireshark to analyze pcap files Usually I use Wireshark to debug networking problems in production. That’s pretty simple! “Decode as” ​Another day, another Intel CPU security hole: Lazy State. Once upon a time, when we worried about security, we worried about our software.

These days, it's our hardware, our CPUs, with problems like Meltdown and Spectre, which are out to get us. The latest Intel revelation, Lazy FP state restore, can theoretically pull data from your programs, including encryption software, from your computer regardless of your operating system. Like its forebears, this is a speculative execution vulnerability. In an interview, Red Hat Computer Architect Jon Masters explained: "It affects Intel designs similar to variant 3-a of the previous stuff, but it's NOT Meltdown. " Still, "it allows the floating point registers to be leaked from another process, but alas that means the same registers as used for crypto, etc. " Lazy State does not affect AMD processors. This vulnerability exists because modern CPUs include many registers (internal memory) that represent the state of each running application. For some operating systems, the fix is already in.

Lessons from Building Observability Tools at Netflix. Our mission at Netflix is to deliver joy to our members by providing high-quality content, presented with a delightful experience. We are constantly innovating on our product at a rapid pace in pursuit of this mission. Our innovations span personalized title recommendations, infrastructure, and application features like downloading and customer profiles. Our growing global member base of 125 million members can choose to enjoy our service on over a thousand types of devices. If you also consider the scale and variety of content, maintaining the quality of experience for all our members is an interesting challenge.

We tackle that challenge by developing observability tools and infrastructure to measure customers’ experiences and analyze those measurements to derive meaningful insights and higher-level conclusions from raw data. By observability, we mean analysis of logs, traces, and metrics. At some point in business growth, we learned that storing raw application logs won’t scale. Understanding Compilers — For Humans – Aesl. Note to reader When I started writing this article, I targeted anyone, regardless of prior knowledge.

I got carried away and just started throwing in technical details too. Now, I suggest this be read by someone with programming experience. Otherwise the significance may not be there. Introduction All a compiler is, is just a program. On most modern operating systems, files are organized into one-dimensional arrays of bytes. The compiler is taking your human-readable source code, analyzing it, then producing a computer-readable code called machine code (binary). Human-readable languages are AKA high-level languages. Int main() { int a = 5; a = a * 5; return 0;} The above is a C program written by a human that does the following in a simpler, even more human readable language called pseudo-code: program 'main' returns an integerbegin store the number '5' in the variable 'a' 'a' equals 'a' times '5' return '0'end This analysis is simplified for easier understanding.

Tokenization Before: After: Strings Are Evil – Indy Singh. Reducing memory allocations from 7.5GB to 32KB Table of Contents Context of the problem Codeweavers is a financial services software company, part of what we do is to enable our customers to bulk import their data into our platform. For our services we require up-to-date information from all our clients, which includes lenders and manufacturers across the UK. This data is then used to power our real-time calculations. In this article we will explore potential optimisations to the import process specifically within the context of reducing memory during the import process. Establishing a baseline The current implementation uses StreamReader and passes each line to the lineParser. The most naive implementation of a line parser that we originally had looked something like this:- The ValueHolder class is used later on in the import process to insert information into the database:- Running this example as a command line application and enabling monitoring:- Easy win 1 Great!

Easy win 2 Skipping commas. Why did I spend 1.5 months creating a Gameboy emulator? · tomek's blog. 09 Feb 2017 For me, the most favorite type of a computer program is an emulator. Being able to run code from a completely different hardware architecture always seemed like a magic. The old computers are great on their own, so this kind of connection between historic machines and the modern computing environment feels almost like a time travel. As a developer I often think about the internal design of an emulator. I imagined this big switch construct that chooses the right operation for the current CPU opcode and the array modelling the memory.

After watching The Ultimate GameBoy talk found on the Hacker News, I realized that the Gameboy architecture is quite simple and maybe writing a running emulator for this kind of machine wouldn’t be that hard - especially that it’s well documented too. I realized later that it wasn’t exactly the truth - creating a working program was quite a challenge. CPU and memory First I implemented all the Gameboy CPU opcodes.

CPU timing Basic GPU implementation. C Is Not a Low-level Language. The March/April issue of acmqueue is out now Programming Languages David Chisnall In the wake of the recent Meltdown and Spectre vulnerabilities, it's worth spending some time looking at root causes. Both of these vulnerabilities involved processors speculatively executing instructions past some kind of access check and allowing the attacker to observe the results via a side channel. Processor vendors are not alone in this. What Is a Low-Level Language? Computer science pioneer Alan Perlis defined low-level languages this way: "A programming language is low level when its programs require attention to the irrelevant.

"5 While, yes, this definition applies to C, it does not capture what people desire in a low-level language. For a language to be "close to the metal," it must provide an abstract machine that maps easily to the abstractions exposed by the target platform. Fast PDP-11 Emulators The quest for high ILP was the direct cause of Spectre and Meltdown. Optimizing C Understanding C 1. 2. What optimizations you can expect from CPU? | Denis Bakhvalov | C++ enthusiast.